diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-23 21:45:03 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-23 21:45:03 +0000 |
commit | 79f226e780449291f5905fac05c0ae864068a28d (patch) | |
tree | b116fb5f8e3f31bd2994d9e8133731eaf24ed818 /clang/unittests/Format/FormatTest.cpp | |
parent | 325e486f9b249a2ff645afb8a4cb7caa36fcd239 (diff) | |
download | bcm5719-llvm-79f226e780449291f5905fac05c0ae864068a28d.tar.gz bcm5719-llvm-79f226e780449291f5905fac05c0ae864068a28d.zip |
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.
llvm-svn: 222642
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 58680e07343..b7ffd958286 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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" |