blob: def4c9dd7a70eaa4ce90ab0ed84c22494299ac4d [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s
Chris Lattnera66b4df2009-03-13 22:00:25 +00002// rdar://6676764
3
4struct S {
5 void (^F)(struct S*);
6} P;
7
8
9@interface T
10
11 - (int)foo: (T (^)(T*)) x;
12@end
13
14void foo(T *P) {
15 [P foo: 0];
16}
17
Mike Stump6cc88f72009-03-20 21:53:12 +000018@interface A
19-(void) im0;
20@end
21
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000022// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t
Daniel Dunbar49f59ec2009-05-14 16:42:16 +000023@implementation A
24-(void) im0 {
25 (void) ^{ return 1; }();
26}
27@end
28
Mike Stump6cc88f72009-03-20 21:53:12 +000029@interface B : A @end
30@implementation B
31-(void) im1 {
32 ^(void) { [super im0]; }();
33}
34@end
Daniel Dunbar49f59ec2009-05-14 16:42:16 +000035