summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-04-06 16:41:39 +0000
committerDaniel Jasper <djasper@google.com>2016-04-06 16:41:39 +0000
commit2cce7b728b88d846713f8f1e69f9cc58623024c2 (patch)
tree66cd63894e9abb4a43ed1438fed0c00349ef54ca /clang/unittests/Format/FormatTest.cpp
parent3768f7005d442fb7ff40e1324d2ca9630d255f35 (diff)
downloadbcm5719-llvm-2cce7b728b88d846713f8f1e69f9cc58623024c2.tar.gz
bcm5719-llvm-2cce7b728b88d846713f8f1e69f9cc58623024c2.zip
clang-format: Fix label-in-if statement in macros where it is actually used.
Before: #define A \ if (a) \ label: \ f() After: #define A \ if (a) \ label: \ f() llvm-svn: 265557
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 55fd5fba4aa..2790f9dab0d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -296,6 +296,7 @@ TEST_F(FormatTest, FormatIfWithoutCompoundStatement) {
verifyFormat("if (a)\n if (b) {\n f();\n }\ng();");
FormatStyle AllowsMergedIf = getLLVMStyle();
+ AllowsMergedIf.AlignEscapedNewlinesLeft = true;
AllowsMergedIf.AllowShortIfStatementsOnASingleLine = true;
verifyFormat("if (a)\n"
" // comment\n"
@@ -307,6 +308,11 @@ TEST_F(FormatTest, FormatIfWithoutCompoundStatement) {
" f();\n"
"}",
AllowsMergedIf);
+ verifyFormat("#define A \\\n"
+ " if (a) \\\n"
+ " label: \\\n"
+ " f()",
+ AllowsMergedIf);
verifyFormat("if (a)\n"
" ;",
AllowsMergedIf);
OpenPOWER on IntegriCloud