summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-04-29 08:29:26 +0000
committerDaniel Jasper <djasper@google.com>2015-04-29 08:29:26 +0000
commiteb45cb7cf9c56ea1c993dfcc59d9bf28057199e3 (patch)
tree61bba500ee44cb28b1c4b6357aa7172453d9a99a /clang/unittests/Format/FormatTest.cpp
parentfda237d09fbe88371e1255acef92fe451201bedc (diff)
downloadbcm5719-llvm-eb45cb7cf9c56ea1c993dfcc59d9bf28057199e3.tar.gz
bcm5719-llvm-eb45cb7cf9c56ea1c993dfcc59d9bf28057199e3.zip
clang-format: Fix selective indentaiton in nested blocks.
Buggy case: someFunction( [] { // comment int i; // invoke formatting here. }, // force line break aaa); llvm-svn: 236091
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b23778aaba8..46266adcac7 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3262,6 +3262,19 @@ TEST_F(FormatTest, IndividualStatementsOfNestedBlocks) {
" int a; //\n"
"});",
0, 0, getLLVMStyle()));
+ EXPECT_EQ("someFunction(\n"
+ " [] {\n"
+ " // Only with this comment.\n"
+ " int i; // invoke formatting here.\n"
+ " }, // force line break\n"
+ " aaa);",
+ format("someFunction(\n"
+ " [] {\n"
+ " // Only with this comment.\n"
+ " int i; // invoke formatting here.\n"
+ " }, // force line break\n"
+ " aaa);",
+ 63, 1, getLLVMStyle()));
}
TEST_F(FormatTest, PutEmptyBlocksIntoOneLine) {
OpenPOWER on IntegriCloud