summaryrefslogtreecommitdiffstats
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-09-04 13:33:52 +0000
committerDaniel Jasper <djasper@google.com>2017-09-04 13:33:52 +0000
commitc55c0db172fe48c0ee64bd86d2cb35c3e38f328b (patch)
tree850a5f4f505311c50d13e2e06820d6cd4918185e /unittests/Format/FormatTest.cpp
parent9b9a71803226ccc3c9310312967117875b9ff77e (diff)
clang-format: Fix indentation of macros in include guards (after r312125).
Before: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H After: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index e0815e7fd0..1c57b50906 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2332,7 +2332,6 @@ TEST_F(FormatTest, IndentPreprocessorDirectives) {
"#define A 1\n"
"#endif",
Style);
-
Style.IndentPPDirectives = FormatStyle::PPDIS_AfterHash;
verifyFormat("#ifdef _WIN32\n"
"# define A 0\n"
@@ -2493,6 +2492,15 @@ TEST_F(FormatTest, IndentPreprocessorDirectives) {
"#\tdefine A 1\n"
"#endif",
Style);
+
+ // Regression test: Multiline-macro inside include guards.
+ verifyFormat("#ifndef HEADER_H\n"
+ "#define HEADER_H\n"
+ "#define A() \\\n"
+ " int i; \\\n"
+ " int j;\n"
+ "#endif // HEADER_H",
+ getLLVMStyleWithColumns(20));
}
TEST_F(FormatTest, FormatHashIfNotAtStartOfLine) {