blob: 0a6bde0886ad368518ebfdd6d8ba5409ba637cd7 [file] [log] [blame]
Steve Naroffeab5f632008-09-23 19:24:41 +00001// RUN: clang -rewrite-blocks %s -o -
2
3typedef void (^test_block_t)();
4
5int main(int argc, char **argv) {
6 int a;
7
8 void (^test_block_v)();
9 void (^test_block_v2)(int, float);
10
11 void (^test_block_v3)(void (^barg)(int));
12
13 a = 77;
14 test_block_v = ^(){ int local=1; printf("a=%d\n",a+local); };
15 test_block_v();
16 a++;
17 test_block_v();
18
19 __block int b;
20
21 b = 88;
22 test_block_v2 = ^(int x, float f){ printf("b=%d\n",b); };
23 test_block_v2(1,2.0);
24 b++;
25 test_block_v2(3,4.0);
26 return 7;
27}