diff options
Diffstat (limited to 'clang/test/Sema/scope-check.c')
-rw-r--r-- | clang/test/Sema/scope-check.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 59fd832dc63..76041c49165 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -164,9 +164,22 @@ L2: return; } +void test11(int n) { + void *P = ^{ + switch (n) { + case 1:; + case 2: + case 3:; + int Arr[n]; // expected-note {{jump bypasses initialization of variable length array}} + case 4: // expected-error {{illegal switch case into protected scope}} + return; + } + }; +} + // TODO: When and if gotos are allowed in blocks, this should work. -void test13(int n) { +void test12(int n) { void *P = ^{ goto L1; // expected-error {{goto not allowed in block literal}} L1: |