Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s |
Chris Lattner | a66b4df | 2009-03-13 22:00:25 +0000 | [diff] [blame] | 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 | |||||
Mike Stump | 6cc88f7 | 2009-03-20 21:53:12 +0000 | [diff] [blame] | 18 | @interface A |
19 | -(void) im0; | ||||
20 | @end | ||||
21 | |||||
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 22 | // RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t |
Daniel Dunbar | 49f59ec | 2009-05-14 16:42:16 +0000 | [diff] [blame] | 23 | @implementation A |
24 | -(void) im0 { | ||||
25 | (void) ^{ return 1; }(); | ||||
26 | } | ||||
27 | @end | ||||
28 | |||||
Mike Stump | 6cc88f7 | 2009-03-20 21:53:12 +0000 | [diff] [blame] | 29 | @interface B : A @end |
30 | @implementation B | ||||
31 | -(void) im1 { | ||||
Chris Lattner | 00e2c63 | 2010-04-12 05:43:31 +0000 | [diff] [blame] | 32 | ^(void) { [self im0]; }(); |
Mike Stump | 6cc88f7 | 2009-03-20 21:53:12 +0000 | [diff] [blame] | 33 | } |
John McCall | ee50429 | 2010-05-21 04:11:14 +0000 | [diff] [blame^] | 34 | -(void) im2 { |
35 | ^{ [super im0]; }(); | ||||
36 | } | ||||
37 | -(void) im3 { | ||||
38 | ^{ ^{[super im0];}(); }(); | ||||
39 | } | ||||
Mike Stump | 6cc88f7 | 2009-03-20 21:53:12 +0000 | [diff] [blame] | 40 | @end |
Daniel Dunbar | 49f59ec | 2009-05-14 16:42:16 +0000 | [diff] [blame] | 41 |