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

Chris Lattner sabre at nondot.org
Sat Apr 18 21:48:07 PDT 2009


Author: lattner
Date: Sat Apr 18 23:48:07 2009
New Revision: 69506

URL: http://llvm.org/viewvc/llvm-project?rev=69506&view=rev
Log:
more testcases of variably modified types.

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=69506&r1=69505&r2=69506&view=diff

==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Sat Apr 18 23:48:07 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify -std=gnu99 %s
+// RUN: clang-cc -fsyntax-only -verify -fblocks -std=gnu99 %s
 
 int test1(int x) {
   goto L;    // expected-error{{illegal goto into protected scope}}
@@ -150,3 +150,17 @@
   };
 }
 
+void test10(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;
+}
+





More information about the cfe-commits mailing list