aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 22:42:18 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 22:42:18 +0000
commit35562d18ea134f88ec09f12626f403a28adb4306 (patch)
treecd40664f7acb91c43362b043e332620c677a1d01
parent5223af8f05eff78bfba57cb154e28fb9def97b45 (diff)
add testcases for some more scary/horrible things that work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69488 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Sema/scope-check.c17
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; });
+}