summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/block-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/block-misc.c')
-rw-r--r--clang/test/Sema/block-misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Sema/block-misc.c b/clang/test/Sema/block-misc.c
index 277d6d20c89..b2d4fd82290 100644
--- a/clang/test/Sema/block-misc.c
+++ b/clang/test/Sema/block-misc.c
@@ -95,4 +95,21 @@ void test9() {
^{ somelabel: ; }();
}
+void test10(int i) {
+ switch (i) {
+ case 41: ;
+ ^{ case 42: ; }(); // expected-error {{'case' statement not in switch statement}}
+ }
+}
+
+void test11(int i) {
+ switch (i) {
+ case 41: ;
+ ^{ break; }(); // expected-error {{'break' statement not in loop or switch statement}}
+ }
+
+ for (; i < 100; ++i)
+ ^{ break; }(); // expected-error {{'break' statement not in loop or switch statement}}
+}
+
OpenPOWER on IntegriCloud