summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-06 15:19:47 +0000
committerDaniel Jasper <djasper@google.com>2015-05-06 15:19:47 +0000
commit1fe0d5ca59ab2e23fc5b9755d83268f649080c61 (patch)
tree0bb4b27b5629d8503a7166fbff43a38e9cef87ba /clang/unittests/Format/FormatTest.cpp
parent112b50e6b627f4780656a4f62f446848e46197b9 (diff)
downloadbcm5719-llvm-1fe0d5ca59ab2e23fc5b9755d83268f649080c61.tar.gz
bcm5719-llvm-1fe0d5ca59ab2e23fc5b9755d83268f649080c61.zip
clang-format: Merge labels and subsequent semicolons.
E.g.: default:; This can be used to get around restrictions as to what can follow a label. It fixes llvm.org/PR19648. llvm-svn: 236604
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b4c8c26664a..000f87ce40c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -692,6 +692,11 @@ TEST_F(FormatTest, FormatsSwitchStatement) {
" case OP_name: \\\n"
" return operations::Operation##name\n",
getLLVMStyleWithColumns(40));
+ verifyFormat("switch (x) {\n"
+ "case 1:;\n"
+ "default:;\n"
+ " int i;\n"
+ "}");
verifyGoogleFormat("switch (x) {\n"
" case 1:\n"
@@ -827,6 +832,11 @@ TEST_F(FormatTest, FormatsLabels) {
"test_label:\n"
" some_other_code();\n"
"}");
+ verifyFormat("{\n"
+ " some_code();\n"
+ "test_label:;\n"
+ " int i = 0;\n"
+ "}");
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud