aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-23 14:37:36 +0000
committerManuel Klimek <klimek@google.com>2013-01-23 14:37:36 +0000
commit7ccbc2156bfe473f080b585130d70e51c4b62bb0 (patch)
tree660cb88969861cf7bb5728a6e1f7545b143d134f /unittests/Format/FormatTest.cpp
parenta32a7fda316289dca6aac1352fde3caf14a1cb2f (diff)
Fix handling of macro definitions.
Now correctly formats: #define A (1) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 806a7eb9c0..708b7d8086 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -742,6 +742,10 @@ TEST_F(FormatTest, HashInMacroDefinition) {
verifyFormat("#define A void # ## #", getLLVMStyleWithColumns(22));
}
+TEST_F(FormatTest, RespectWhitespaceInMacroDefinitions) {
+ verifyFormat("#define A (1)");
+}
+
TEST_F(FormatTest, IndentPreprocessorDirectivesAtZero) {
EXPECT_EQ("{\n {\n#define A\n }\n}", format("{{\n#define A\n}}"));
}