summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-12-07 16:44:49 +0000
committerDaniel Jasper <djasper@google.com>2014-12-07 16:44:49 +0000
commitb0dfccf692897e7388e8e3fb020a26db79161b39 (patch)
treea54b6d594cd3b5b4c1a5a794e0be2e88dac2df4d /unittests
parentaca856675ccdfe41b04cf954f1bcd6555946e79d (diff)
clang-format: Don't merge lines with comments.
Before: int f() { // comment return 42; } After: int f() { // comment return 42; } This fixes llvm.org/PR21769. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index cf2d8097f7..8664711aa0 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -8372,6 +8372,11 @@ TEST_F(FormatTest, AllmanBraceBreaking) {
" [object someMethod:@{ @\"a\" : @\"b\" }];\n"
"}",
AllmanBraceStyle);
+ verifyFormat("int f()\n"
+ "{ // comment\n"
+ " return 42;\n"
+ "}",
+ AllmanBraceStyle);
AllmanBraceStyle.ColumnLimit = 19;
verifyFormat("void f() { int i; }", AllmanBraceStyle);