diff options
| author | Daniel Jasper <djasper@google.com> | 2014-01-03 11:50:46 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-01-03 11:50:46 +0000 |
| commit | 352dae199ae80adcaf6aed485d687fc8714fe36d (patch) | |
| tree | 50d9e42b990f2fb97566b89cd4cd0b3f172c4fe8 /clang/unittests/Format/FormatTest.cpp | |
| parent | b045d8bc0703341a9ec44d76cbe13b0fcd201745 (diff) | |
| download | bcm5719-llvm-352dae199ae80adcaf6aed485d687fc8714fe36d.tar.gz bcm5719-llvm-352dae199ae80adcaf6aed485d687fc8714fe36d.zip | |
clang-format: Recognize single-line macro usages inside macros.
Before:
#define LIST(L) \
L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
L(FifthElement)
After:
#define LIST(L) \
L(FirstElement) \
L(SecondElement) \
L(ThirdElement) \
L(FourthElement) \
L(FifthElement)
llvm-svn: 198407
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 66b54ab9d21..232a0635581 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2198,6 +2198,17 @@ TEST_F(FormatTest, MacroCallsWithoutTrailingSemicolon) { " IPC_END_MESSAGE_MAP()\n" "}")); + // Same inside macros. + EXPECT_EQ("#define LIST(L) \\\n" + " L(A) \\\n" + " L(B) \\\n" + " L(C)", + format("#define LIST(L) \\\n" + " L(A) \\\n" + " L(B) \\\n" + " L(C)", + getGoogleStyle())); + // These must not be recognized as macros. EXPECT_EQ("int q() {\n" " f(x);\n" |

