summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-13 16:10:20 +0000
committerDaniel Jasper <djasper@google.com>2013-01-13 16:10:20 +0000
commit942ee72affb3c13f1debc6084f8708d298165563 (patch)
tree5fdbb61e1cbbb7a4c4b3f5fb7aa035a4af3d8863 /clang/unittests/Format/FormatTest.cpp
parentbb13a3c4574d89a2bb11f966bdd90cf6d10e42e0 (diff)
downloadbcm5719-llvm-942ee72affb3c13f1debc6084f8708d298165563.tar.gz
bcm5719-llvm-942ee72affb3c13f1debc6084f8708d298165563.zip
Stronger respect the input codes line breaks wrt. comments.
clang-format should not change whether or not there is a line break before a line comment as this strongly influences the percieved binding. User input: void f(int a, // b is awesome int b); void g(int a, // a is awesome int b); Before: void f(int a, // b is awesome int b); void g(int a, // a is awesome int b); After: <unchanged from input> llvm-svn: 172361
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f3da5061f26..a8417f1efdc 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -285,6 +285,14 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
verifyFormat("void f() {\n"
" // Doesn't do anything\n"
"}");
+ verifyFormat("void f(int i, // some comment (probably for i)\n"
+ " int j, // some comment (probably for j)\n"
+ " int k); // some comment (probably for k)");
+ verifyFormat("void f(int i,\n"
+ " // some comment (probably for j)\n"
+ " int j,\n"
+ " // some comment (probably for k)\n"
+ " int k);");
verifyFormat("int i // This is a fancy variable\n"
" = 5;");
OpenPOWER on IntegriCloud