diff options
-rw-r--r-- | test/Sema/scope-check.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c index b7e3a21d55..181b6c5aa4 100644 --- a/test/Sema/scope-check.c +++ b/test/Sema/scope-check.c @@ -56,5 +56,18 @@ void test7(int x) { } } - -// FIXME: Switch cases etc. +int test8(int x) { + if (x) goto L; // expected-error {{illegal goto into protected scope}} + goto L2; // expected-error {{illegal goto into protected scope}} + + for (int arr[x]; // expected-note {{jump bypasses initialization of variable length array}} + ; ++x) { + + L2:; + } + + return x == ({ + int a[x]; // expected-note {{jump bypasses initialization of variable length array}} + L: + 42; }); +} |