diff options
-rw-r--r-- | clang/test/Sema/scope-check.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c index 83b84777a93..1eb47e76439 100644 --- a/clang/test/Sema/scope-check.c +++ b/clang/test/Sema/scope-check.c @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=gnu99 %s +// RUN: clang-cc -fsyntax-only -verify -fblocks -std=gnu99 %s int test1(int x) { goto L; // expected-error{{illegal goto into protected scope}} @@ -150,3 +150,17 @@ L4: }; } +void test10(int n, void *P) { + goto L0; // expected-error {{illegal goto into protected scope}} + typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}} +L0: + + goto L1; // expected-error {{illegal goto into protected scope}} + A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}} +L1: + goto L2; // expected-error {{illegal goto into protected scope}} + A d[n]; // expected-note {{jump bypasses initialization of variable length array}} +L2: + return; +} + |