]> granicus.if.org Git - clang/commitdiff
more testcases of variably modified types.
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 04:48:07 +0000 (04:48 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 04:48:07 +0000 (04:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69506 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/scope-check.c

index 83b84777a932bc7d5a8ad85781934c818b96bd8f..1eb47e76439a3bed8b7832d39d41f1486f92040f 100644 (file)
@@ -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 @@ L4:
   };
 }
 
+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;
+}
+