summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-05 10:48:04 +0000
committerDaniel Jasper <djasper@google.com>2014-11-05 10:48:04 +0000
commit680b09ba8825311dc0fad69ed166a21e3f83bcbe (patch)
tree9bc01e3b874ddf2bcd236eced5b664982a3f31c5 /clang/unittests/Format/FormatTest.cpp
parent70a3841a8fb0e4a2360cec3496c2eb984cdccc14 (diff)
downloadbcm5719-llvm-680b09ba8825311dc0fad69ed166a21e3f83bcbe.tar.gz
bcm5719-llvm-680b09ba8825311dc0fad69ed166a21e3f83bcbe.zip
clang-format: Improve free-standing macro detection.
Before: SOME_WEIRD_LOG_MACRO << "Something long enough to cause a line break"; After: SOME_WEIRD_LOG_MACRO << "Something long enough to cause a line break"; llvm-svn: 221338
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index cd832651066..9e63bd11bb3 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2569,6 +2569,11 @@ TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) {
" Q_Object\n"
" A() {\n}\n"
"} ;"));
+
+ // Only if the next line can actually start an unwrapped line.
+ EXPECT_EQ("SOME_WEIRD_LOG_MACRO << SomeThing;",
+ format("SOME_WEIRD_LOG_MACRO\n"
+ "<< SomeThing;"));
}
TEST_F(FormatTest, MacroCallsWithoutTrailingSemicolon) {
OpenPOWER on IntegriCloud