diff options
author | Daniel Jasper <djasper@google.com> | 2013-10-20 17:28:32 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-10-20 17:28:32 +0000 |
commit | dcd5da1fd9352473a8b08c982780f6b14994316f (patch) | |
tree | bae21e60bc5bdfc1e3c86e88cb1b53ead5f4af3a /clang/unittests/Format/FormatTest.cpp | |
parent | 2d0cd4978737bdde886d70cb82d5ce8fb385bfa2 (diff) | |
download | bcm5719-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.cpp | 6 |
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" |