opnsense-src/test/CodeGenObjC/blocks.m

36 lines
478 B
Mathematica
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -fblocks -o %t %s
2009-06-02 13:58:47 -04: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];
}
@interface A
-(void) im0;
@end
2009-11-18 09:59:57 -05:00
// RUN: grep 'define internal i32 @"__-\[A im0\]_block_invoke_"' %t
2009-06-02 13:58:47 -04:00
@implementation A
-(void) im0 {
(void) ^{ return 1; }();
}
@end
@interface B : A @end
@implementation B
-(void) im1 {
^(void) { [super im0]; }();
}
@end