diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index d5c7978e7b..89fe71c5ba 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -458,6 +458,14 @@ TEST_F(FormatTest, MacroDefinitionInsideStatement) { EXPECT_EQ("int x,\n#define A\ny;", format("int x,\n#define A\ny;")); } +TEST_F(FormatTest, HashInMacroDefinition) { + verifyFormat("#define A \\\n b #c;", getLLVMStyleWithColumns(11)); + verifyFormat("#define A \\\n" + " { \\\n" + " f(#c);\\\n" + " }", getLLVMStyleWithColumns(11)); +} + // 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 |