summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 22217c06f4c..e6dee38fb08 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3284,6 +3284,18 @@ TEST_F(FormatTest, LayoutNestedBlocks) {
verifyNoCrash("^{v^{a}}");
}
+TEST_F(FormatTest, FormatNestedBlocksInMacros) {
+ EXPECT_EQ("#define MACRO() \\\n"
+ " Debug(aaa, /* force line break */ \\\n"
+ " { \\\n"
+ " int i; \\\n"
+ " int j; \\\n"
+ " })",
+ format("#define MACRO() Debug(aaa, /* force line break */ \\\n"
+ " { int i; int j; })",
+ getGoogleStyle()));
+}
+
TEST_F(FormatTest, IndividualStatementsOfNestedBlocks) {
EXPECT_EQ("DEBUG({\n"
" int i;\n"
OpenPOWER on IntegriCloud