summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-05-19 06:30:48 +0000
committerDaniel Jasper <djasper@google.com>2016-05-19 06:30:48 +0000
commit451544ab57dc5c8ec187d1ce7e1ddc049d4d1b76 (patch)
treea0e1780c1d7f65731b866586e2d1b9ffbf0b6f05 /clang/unittests/Format
parente2fab133133c4c652ca27b791805b158b9d0a20a (diff)
downloadbcm5719-llvm-451544ab57dc5c8ec187d1ce7e1ddc049d4d1b76.tar.gz
bcm5719-llvm-451544ab57dc5c8ec187d1ce7e1ddc049d4d1b76.zip
clang-format: Fix incorrect indentation in last line of macro definition
Before: #define MACRO(a) \ if (a) { \ f(); \ } else \ g() After: #define MACRO(a) \ if (a) { \ f(); \ } else \ g() llvm-svn: 270028
Diffstat (limited to 'clang/unittests/Format')
-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 aec801ccc98..27379b7d6c7 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2767,6 +2767,12 @@ TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) {
" case 1: \\\n"
" case 2\n",
getLLVMStyleWithColumns(20));
+ verifyFormat("#define MACRO(a) \\\n"
+ " if (a) \\\n"
+ " f(); \\\n"
+ " else \\\n"
+ " g()",
+ getLLVMStyleWithColumns(18));
verifyFormat("#define A template <typename T>");
verifyIncompleteFormat("#define STR(x) #x\n"
"f(STR(this_is_a_string_literal{));");
OpenPOWER on IntegriCloud