]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenObjC/blocks.m
Update clang to r89205.
[FreeBSD/FreeBSD.git] / test / CodeGenObjC / blocks.m
1 // RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s
2 // rdar://6676764
3
4 struct S {
5   void (^F)(struct S*);
6 } P;
7
8
9 @interface T
10
11   - (int)foo: (T (^)(T*)) x;
12 @end
13
14 void foo(T *P) {
15  [P foo: 0];
16 }
17
18 @interface A 
19 -(void) im0;
20 @end
21
22 // RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t
23 @implementation A
24 -(void) im0 {
25   (void) ^{ return 1; }();
26 }
27 @end
28
29 @interface B : A @end
30 @implementation B
31 -(void) im1 {
32   ^(void) { [super im0]; }();
33 }
34 @end
35