aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/scope-check.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 23:01:20 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 23:01:20 +0000
commit2b7b2ca64ad8d293d10909a7ac119fa3fc10c95c (patch)
tree38be9549d1930741fb89c927cb9b36456e3e11f5 /test/Sema/scope-check.c
parent5b40e0cebcb883540ec3005c47a960107e65f375 (diff)
reimplement DeclStmt handling so that we correctly handle intermixed
VLA's and statement expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/scope-check.c')
-rw-r--r--test/Sema/scope-check.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Sema/scope-check.c b/test/Sema/scope-check.c
index 10316950fe..7a35f07be0 100644
--- a/test/Sema/scope-check.c
+++ b/test/Sema/scope-check.c
@@ -68,6 +68,35 @@ int test8(int x) {
int Y = ({ int a[x]; // expected-note {{jump bypasses initialization of variable length array}}
L3: 4; });
+ goto L4; // expected-error {{illegal goto into protected scope}}
+ {
+ int A[x], // expected-note {{jump bypasses initialization of variable length array}}
+ B[x]; // expected-note {{jump bypasses initialization of variable length array}}
+ L4: ;
+ }
+
+ {
+ L5: ;// ok
+ int A[x], B = ({ if (x)
+ goto L5;
+ else
+ goto L6;
+ 4; });
+ L6:; // ok.
+ }
+
+ {
+ L7: ;// ok
+ int A[x], B = ({ if (x)
+ goto L7;
+ else
+ goto L8; // expected-error {{illegal goto into protected scope}}
+ 4; }),
+ C[x]; // expected-note {{jump bypasses initialization of variable length array}}
+ L8:; // bad
+ }
+
+
// Statement expressions 2.
goto L1; // expected-error {{illegal goto into protected scope}}
return x == ({