diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-18 19:32:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-18 19:32:54 +0000 |
commit | 5718a351b3da578366ec6f07670ca33b7d9726a3 (patch) | |
tree | f7e21a1d84b0678f9ccaffc0f4b4c1d41488c262 | |
parent | e32f74c7af4064a08aaf21fc181de72138450197 (diff) |
add some block goto test cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69460 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Sema/block-misc.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c index ea3477d263..277d6d20c8 100644 --- a/test/Sema/block-misc.c +++ b/test/Sema/block-misc.c @@ -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: ; }(); +} + + |