summaryrefslogtreecommitdiffstats
path: root/clang/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
commit4df130f94192faf5cb8535a9fdce18d1c4c33de1 (patch)
tree2645be312e9578f54cf630b858bafa741d8daf3b /clang/unittests/Format/FormatTest.cpp
parent1fab4f8a593099fb1b8964f5e9f9b6e4dfd6e8aa (diff)
downloadbcm5719-llvm-4df130f94192faf5cb8535a9fdce18d1c4c33de1.tar.gz
bcm5719-llvm-4df130f94192faf5cb8535a9fdce18d1c4c33de1.zip
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 llvm-svn: 312484
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index e0815e7fd06..1c57b509064 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud