[cfe-commits] r69460 - /cfe/trunk/test/Sema/block-misc.c

Chris Lattner sabre at nondot.org
Sat Apr 18 12:32:54 PDT 2009


Author: lattner
Date: Sat Apr 18 14:32:54 2009
New Revision: 69460

URL: http://llvm.org/viewvc/llvm-project?rev=69460&view=rev
Log:
add some block goto test cases.

Modified:
    cfe/trunk/test/Sema/block-misc.c

Modified: cfe/trunk/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-misc.c?rev=69460&r1=69459&r2=69460&view=diff

==============================================================================
--- cfe/trunk/test/Sema/block-misc.c (original)
+++ cfe/trunk/test/Sema/block-misc.c Sat Apr 18 14:32:54 2009
@@ -78,7 +78,21 @@
 }
 
 // radr://6732116 - block comparisons
-void (^g)();
-int foo(void (^p)()) {
-  return g == p;
+void (^test7a)();
+int test7(void (^p)()) {
+  return test7a == p;
 }
+
+
+void test8() {
+somelabel:
+ // FIXME: This should say "jump out of block not legal" when gotos are allowed.
+  ^{ goto somelabel; }();   // expected-error {{goto not allowed in block literal}}
+}
+
+void test9() {
+  goto somelabel;       // expected-error {{use of undeclared label 'somelabel'}}
+  ^{ somelabel: ; }();
+}
+
+





More information about the cfe-commits mailing list