summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-12 20:17:17 +0000
committerDaniel Jasper <djasper@google.com>2013-02-12 20:17:17 +0000
commitf52ab8d60cfc3222b7b7543c8789e1c507b1b438 (patch)
treed83a8ceb6f8db8b582798e395358cc08ab7fd502 /clang/unittests
parent4d3c008c7d1ec5a6ef0c4426c216c62d179df16d (diff)
downloadbcm5719-llvm-f52ab8d60cfc3222b7b7543c8789e1c507b1b438.tar.gz
bcm5719-llvm-f52ab8d60cfc3222b7b7543c8789e1c507b1b438.zip
Fix crash for incomplete labels in macros.
Still the formatting can be improved, but at least we don't assert any more. This happened when trying to format lib/Sema/SemaType.cpp. llvm-svn: 175003
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f1cef2a03d1..f28bc884445 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -353,6 +353,12 @@ TEST_F(FormatTest, FormatsSwitchStatement) {
"}");
verifyFormat("switch (test)\n"
" ;");
+
+ // FIXME: Improve formatting of case labels in macros.
+ verifyFormat("#define SOMECASES \\\n"
+ "case 1: \\\n"
+ " case 2\n", getLLVMStyleWithColumns(20));
+
verifyGoogleFormat("switch (x) {\n"
" case 1:\n"
" f();\n"
OpenPOWER on IntegriCloud