summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd053c5b43a91c9a6bbc32722c8196d131228d9fc (patch)
tree26e31b178fb434512fc1697875059478957770f5 /clang/unittests/Format/FormatTest.cpp
parentd1bfdc32b2bfd2169777881a764947b61b42a509 (diff)
downloadbcm5719-llvm-d053c5b43a91c9a6bbc32722c8196d131228d9fc.tar.gz
bcm5719-llvm-d053c5b43a91c9a6bbc32722c8196d131228d9fc.zip
Fix handling of macro definitions.
Now correctly formats: #define A (1) llvm-svn: 173264
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 806a7eb9c08..708b7d8086a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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}}"));
}
OpenPOWER on IntegriCloud