| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s |
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | int printf(char const *, ...); |
| 5 | |
| 6 | struct blockStruct { |
| 7 | int (^a)(float, int); |
| 8 | int b; |
| 9 | }; |
| 10 | |
| 11 | int blockTaker (int (^myBlock)(int), int other_input) |
| 12 | { |
| 13 | return 5 * myBlock (other_input); |
| 14 | } |
| 15 | |
| 16 | int main (int argc, char **argv) |
| 17 | { |
| 18 | int (^blockptr) (int) = ^(int inval) { |
| 19 | printf ("Inputs: %d, %d.\n", argc, inval); |
| 20 | return argc * inval; |
| 21 | }; |
| 22 | |
| 23 | |
| 24 | argc = 10; |
| 25 | printf ("I got: %d.\n", |
| 26 | blockTaker (blockptr, 6)); |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | |