]> granicus.if.org Git - clang/commitdiff
add some block goto test cases.
authorChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 19:32:54 +0000 (19:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Apr 2009 19:32:54 +0000 (19:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69460 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/block-misc.c

index ea3477d2639d10cc8f94a5ec25fdb685715e259e..277d6d20c89bd95b05b03b2b4a26383e9fb1a43f 100644 (file)
@@ -78,7 +78,21 @@ const char*test6() {
 }
 
 // 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: ; }();
+}
+
+