summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-16 10:17:39 +0000
committerDaniel Jasper <djasper@google.com>2013-05-16 10:17:39 +0000
commitf9eb9b18830349057d4608ecbac2077e84906f5c (patch)
treeed87fd9366b1dae702324ca1ddc5ee06eb2ed6c1 /clang/unittests/Format/FormatTest.cpp
parent950f318ff1ab860881f5939cb1cdeef2337e3967 (diff)
downloadbcm5719-llvm-f9eb9b18830349057d4608ecbac2077e84906f5c.tar.gz
bcm5719-llvm-f9eb9b18830349057d4608ecbac2077e84906f5c.zip
Comments should not prevent single-line functions.
Before: void f() {} void g() { } // comment After: void f() {} void g() {} // comment llvm-svn: 181996
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b39280edd81..8ee0245d1db 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3043,6 +3043,8 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {
" int a;\n"
"#error {\n"
"}");
+ verifyFormat("void f() {} // comment");
+ verifyFormat("void f() { int a; } // comment");
verifyFormat("void f() { return 42; }", getLLVMStyleWithColumns(23));
verifyFormat("void f() {\n return 42;\n}", getLLVMStyleWithColumns(22));
OpenPOWER on IntegriCloud