2009-05-15 00:42:16 +08:00
|
|
|
// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s &&
|
2009-03-14 06:00:25 +08:00
|
|
|
// rdar://6676764
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
void (^F)(struct S*);
|
|
|
|
} P;
|
|
|
|
|
|
|
|
|
|
|
|
@interface T
|
|
|
|
|
|
|
|
- (int)foo: (T (^)(T*)) x;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void foo(T *P) {
|
|
|
|
[P foo: 0];
|
|
|
|
}
|
|
|
|
|
2009-03-21 05:53:12 +08:00
|
|
|
@interface A
|
|
|
|
-(void) im0;
|
|
|
|
@end
|
|
|
|
|
2009-05-15 00:42:16 +08:00
|
|
|
// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t &&
|
|
|
|
@implementation A
|
|
|
|
-(void) im0 {
|
|
|
|
(void) ^{ return 1; }();
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-03-21 05:53:12 +08:00
|
|
|
@interface B : A @end
|
|
|
|
@implementation B
|
|
|
|
-(void) im1 {
|
|
|
|
^(void) { [super im0]; }();
|
|
|
|
}
|
|
|
|
@end
|
2009-05-15 00:42:16 +08:00
|
|
|
|
|
|
|
// RUN: true
|