diff options
Diffstat (limited to 'test/Sema/scope-check.c')
-rw-r--r-- | test/Sema/scope-check.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index 4c3480ea27..59d4d134a8 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -46,5 +46,16 @@ int test6() { goto x; // expected-error {{use of undeclared label 'x'}} } +void test7(int x) { +foo: + switch (x) { // expected-error {{illegal switch into protected scope}} + case 1: ; + int a[x]; // expected-note {{jump bypasses initialization of variable length array}} + case 2: + a[1] = 2; + break; + } +} + // FIXME: Switch cases etc. |