summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-20 17:28:32 +0000
committerDaniel Jasper <djasper@google.com>2013-10-20 17:28:32 +0000
commitdcd5da1fd9352473a8b08c982780f6b14994316f (patch)
treebae21e60bc5bdfc1e3c86e88cb1b53ead5f4af3a /clang/unittests/Format/FormatTest.cpp
parent2d0cd4978737bdde886d70cb82d5ce8fb385bfa2 (diff)
downloadbcm5719-llvm-dcd5da1fd9352473a8b08c982780f6b14994316f.tar.gz
bcm5719-llvm-dcd5da1fd9352473a8b08c982780f6b14994316f.zip
clang-format: Fix formatting of nested blocks after comment.
Before: DEBUG({ // Comment that used to confuse clang-format. fdafas(); }); Before: DEBUG({ // Comments are now fine. fdafas(); }); This fixed llvm.org/PR17619. llvm-svn: 193051
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index ad1cf75392b..16471b754a3 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2397,6 +2397,12 @@ TEST_F(FormatTest, LayoutNestedBlocks) {
"});",
getLLVMStyleWithColumns(29)));
EXPECT_EQ("DEBUG({ int i; });", format("DEBUG({ int i; });"));
+ EXPECT_EQ("DEBUG({ // comment\n"
+ " int i;\n"
+ "});",
+ format("DEBUG({ // comment\n"
+ "int i;\n"
+ "});"));
EXPECT_EQ("DEBUG({\n"
" int i;\n"
"\n"
OpenPOWER on IntegriCloud