]> granicus.if.org Git - clang/commitdiff
apparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if...
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 04:51:27 +0000 (04:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 04:51:27 +0000 (04:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69507 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/scope-check.c

index 1eb47e76439a3bed8b7832d39d41f1486f92040f..1d1c5aa2f9b2a2fbaaf9d550c70a66df4b5c1a4d 100644 (file)
@@ -164,3 +164,27 @@ L2:
   return;
 }
 
+// TODO: When and if gotos are allowed in blocks, this should work.
+void test11(int n) {
+  void *P = ^{
+    goto L1;  // expected-error {{goto not allowed in block literal}}
+  L1:
+    goto L2;  // expected-error {{goto not allowed in block literal}}
+  L2:
+    goto L3;    // expected-error {{goto not allowed in block literal}}
+      // todo-error {{illegal goto into protected scope}}
+    int Arr[n]; // todo-note {{jump bypasses initialization of variable length array}}
+  L3:
+    goto L4;  // expected-error {{goto not allowed in block literal}}
+  L4: return;
+  };
+}
+
+
+
+#if 0
+// in Sema::CheckVariableDeclaration
+// FIXME: This won't give the correct result for
+// int a[10][n];    
+#endif
+