aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index a64a5bc2ad..0095d58c6b 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2946,6 +2946,17 @@ TEST_F(FormatTest, DoNotInterfereWithErrorAndWarning) {
EXPECT_EQ("#warning 1", format(" # warning 1"));
}
+TEST_F(FormatTest, FormatHashIfExpressions) {
+ // FIXME: Come up with a better indentation for #elif.
+ verifyFormat(
+ "#if !defined(AAAAAAA) && (defined CCCCCC || defined DDDDDD) && \\\n"
+ " defined(BBBBBBBB)\n"
+ "#elif !defined(AAAAAA) && (defined CCCCC || defined DDDDDD) && \\\n"
+ " defined(BBBBBBBB)\n"
+ "#endif",
+ getLLVMStyleWithColumns(65));
+}
+
TEST_F(FormatTest, MergeHandlingInTheFaceOfPreprocessorDirectives) {
FormatStyle AllowsMergedIf = getGoogleStyle();
AllowsMergedIf.AllowShortIfStatementsOnASingleLine = true;