aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-05 22:14:16 +0000
committerManuel Klimek <klimek@google.com>2013-01-05 22:14:16 +0000
commitc37b4d60f926bf440dfcc312bd6482fed3176e33 (patch)
treec1dd06f2f3ef4c91bb88df9d9418b11d93d03185 /unittests/Format/FormatTest.cpp
parent9ef1518fb0e7ab7586655265de5f69c9310bc2e6 (diff)
Fixes PR14801 - preprocessor directives shouldn't be indented
Uses indent 0 for macros for now and resets the indent state to the level prior to the preprocessor directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 89fe71c5ba..2165056a7f 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -466,9 +466,12 @@ TEST_F(FormatTest, HashInMacroDefinition) {
" }", getLLVMStyleWithColumns(11));
}
+TEST_F(FormatTest, IndentPreprocessorDirectivesAtZero) {
+ EXPECT_EQ("{\n {\n#define A\n }\n}", format("{{\n#define A\n}}"));
+}
+
// FIXME: write test for unbalanced braces in macros...
-// FIXME: test { { #include "a.h" } }
-// FIXME: test # in the middle of a statement without \n before it
+// FIXME: test # inside a normal statement (like {#define A b})
TEST_F(FormatTest, MixingPreprocessorDirectivesAndNormalCode) {
EXPECT_EQ(