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

Chris Lattner sabre at nondot.org
Sat Apr 18 21:51:27 PDT 2009


Author: lattner
Date: Sat Apr 18 23:51:27 2009
New Revision: 69507

URL: http://llvm.org/viewvc/llvm-project?rev=69507&view=rev
Log:
apparently gotos aren't allowed at all in blocks.  Stub out a testcase for when/if they are.

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

==============================================================================
--- cfe/trunk/test/Sema/scope-check.c (original)
+++ cfe/trunk/test/Sema/scope-check.c Sat Apr 18 23:51:27 2009
@@ -164,3 +164,27 @@
   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
+





More information about the cfe-commits mailing list