summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-29 08:46:20 +0000
committerDaniel Jasper <djasper@google.com>2013-11-29 08:46:20 +0000
commite40caf9ad2e0566f8293fc704379db75edf08cf6 (patch)
tree14cfd26344379489ab93626211613bdeb791d9ac /clang/unittests/Format/FormatTest.cpp
parent1df3205e8c18af61cbb840ba8860d35c045d186e (diff)
downloadbcm5719-llvm-e40caf9ad2e0566f8293fc704379db75edf08cf6.tar.gz
bcm5719-llvm-e40caf9ad2e0566f8293fc704379db75edf08cf6.zip
clang-format: Fix bad indentation of nested blocks.
Before: DEBUG( // { f(); }); After: DEBUG( // { f(); }); Also add additional test to selected formatting of individual statements in nested blocks. llvm-svn: 195952
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index d809421a41f..e1960d290f8 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2465,6 +2465,14 @@ TEST_F(FormatTest, LayoutNestedBlocks) {
" somethingelse();\n"
"});",
getLLVMStyleWithColumns(40));
+ verifyFormat("DEBUG( //\n"
+ " { f(); }, a);");
+ verifyFormat("DEBUG( //\n"
+ " {\n"
+ " f(); //\n"
+ " },\n"
+ " a);");
+
EXPECT_EQ("call(parameter, {\n"
" something();\n"
" // Comment too\n"
@@ -2532,6 +2540,15 @@ TEST_F(FormatTest, IndividualStatementsOfNestedBlocks) {
" int j;\n"
"} ) ;",
41, 1, getLLVMStyle()));
+ EXPECT_EQ("DEBUG( {\n"
+ " int i;\n"
+ " int j;\n"
+ "} ) ;",
+ format("DEBUG( {\n"
+ " int i;\n"
+ " int j;\n"
+ "} ) ;",
+ 41, 1, getLLVMStyle()));
EXPECT_EQ("DEBUG({\n"
" int i;\n"
" int j;\n"
OpenPOWER on IntegriCloud