[cfe-commits] r69508 - /cfe/trunk/test/SemaObjC/scope-check.m

Chris Lattner sabre at nondot.org
Sat Apr 18 22:20:37 PDT 2009


Author: lattner
Date: Sun Apr 19 00:20:37 2009
New Revision: 69508

URL: http://llvm.org/viewvc/llvm-project?rev=69508&view=rev
Log:
test that vlas are checked in an objc method context.

Modified:
    cfe/trunk/test/SemaObjC/scope-check.m

Modified: cfe/trunk/test/SemaObjC/scope-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/scope-check.m?rev=69508&r1=69507&r2=69508&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/scope-check.m (original)
+++ cfe/trunk/test/SemaObjC/scope-check.m Sun Apr 19 00:20:37 2009
@@ -74,4 +74,20 @@
   blargh: ;
   }
 }
+
++ (void)meth2 {
+    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;
+}
+
 @end





More information about the cfe-commits mailing list