]> granicus.if.org Git - clang/commitdiff
add testcases for some more scary/horrible things that work.
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 22:42:18 +0000 (22:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 22:42:18 +0000 (22:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69488 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/scope-check.c

index b7e3a21d55f239dd992a6b86fd1d110d19ed6271..181b6c5aa493dfa0bee3bca8438be7b394434dc2 100644 (file)
@@ -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; });
+}