summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-21 22:49:20 +0000
committerDaniel Jasper <djasper@google.com>2013-01-21 22:49:20 +0000
commit304a986a7295483c0d9a7938a16107f1c3602666 (patch)
tree0936670908618db5477c1939c9dc70d1fe02c084 /clang/unittests/Format/FormatTest.cpp
parentb7abb30d77b79b929b6e52d58ca8dc89688a3f2b (diff)
downloadbcm5719-llvm-304a986a7295483c0d9a7938a16107f1c3602666.tar.gz
bcm5719-llvm-304a986a7295483c0d9a7938a16107f1c3602666.zip
Remove "incorrect" aligning of trailing comments.
We used to align trailing comments belong to different things. Before: void f() { // some function.. } int a; // some variable.. After: void f() { // some function.. } int a; // some variable.. llvm-svn: 173100
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index c9b255ce414..ba6d7519c6c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -404,6 +404,21 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
" // Comment inside a statement.\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;");
+ EXPECT_EQ("void f() { // This does something ..\n"
+ "}\n"
+ "int a; // This is unrelated",
+ format("void f() { // This does something ..\n"
+ " }\n"
+ "int a; // This is unrelated"));
+ EXPECT_EQ("void f() { // This does something ..\n"
+ "} // awesome..\n"
+ "\n"
+ "int a; // This is unrelated",
+ format("void f() { // This does something ..\n"
+ " } // awesome..\n"
+ " \n"
+ "int a; // This is unrelated"));
+
EXPECT_EQ("int i; // single line trailing comment",
format("int i;\\\n// single line trailing comment"));
OpenPOWER on IntegriCloud