From 1fe0d5ca59ab2e23fc5b9755d83268f649080c61 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 6 May 2015 15:19:47 +0000 Subject: 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 --- clang/unittests/Format/FormatTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') 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" + "}"); } //===----------------------------------------------------------------------===// -- cgit v1.2.3