[cfe-commits] r69488 - /cfe/trunk/test/Sema/scope-check.c

Chris Lattner sabre at nondot.org
Sat Apr 18 15:42:18 PDT 2009


Author: lattner
Date: Sat Apr 18 17:42:18 2009
New Revision: 69488

URL: http://llvm.org/viewvc/llvm-project?rev=69488&view=rev
Log:
add testcases for some more scary/horrible things that work.

Modified:
    cfe/trunk/test/Sema/scope-check.c

Modified: cfe/trunk/test/Sema/scope-check.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/scope-check.c?rev=69488&r1=69487&r2=69488&view=diff

==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Sat Apr 18 17:42:18 2009
@@ -56,5 +56,18 @@
   }
 }
 
-
-// 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; });
+}





More information about the cfe-commits mailing list