summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-23 21:45:03 +0000
committerDaniel Jasper <djasper@google.com>2014-11-23 21:45:03 +0000
commitfb768e1bdab31e04f255861b93bdf641b98cbaed (patch)
tree54b0ebc885761e0ef1f7c6f34068d0755aee7e2f /unittests
parent0389421cac43a0014e15eabcb4af30eac6921dfd (diff)
clang-format: Make short case labels work with #ifs
Before: switch (a) { #if FOO case 0: return 0; #endif } After: switch (a) { #if FOO case 0: return 0; #endif } This fixed llvm.org/PR21544. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 58680e0734..b7ffd95828 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -754,6 +754,12 @@ TEST_F(FormatTest, ShortCaseLabels) {
"}",
Style);
verifyFormat("switch (a) {\n"
+ "#if FOO\n"
+ "case 0: return 0;\n"
+ "#endif\n"
+ "}",
+ Style);
+ verifyFormat("switch (a) {\n"
"case 1: {\n"
"}\n"
"case 2: {\n"