| // RUN: %clang_cc1 -fsyntax-only %s -verify -fblocks |
| int printf(const char*, ...); |
| typedef void (^T) (void); |
| int takeintint(int (^C)(int)) { return C(4); } |
| noop = ^{printf("\nClosure\n"); }; |
| return ^{printf("\nClosure\n"); }; |
| takeblock(^{ printf("%d\n", x); }); |
| break; // expected-error {{'break' statement not in loop or switch statement}} |
| continue; // expected-error {{'continue' statement not in loop statement}} |
| goto foo; // expected-error {{use of undeclared label 'foo'}} |
| takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}} |
| __block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}} |
| void (^noop)(void) = ^{}; |
| void myfunc(int (^block)(int)) {} |
| void myfunc3(const int *x); |
| static int global_x = 10; |
| void (^global_block)(void) = ^{ printf("global x is %d\n", global_x); }; |
| typedef void (^void_block_t)(void); |
| static const void_block_t myBlock = ^{ }; |
| static const void_block_t myBlock2 = ^ void(void) { }; |