2013-12-04 11:41:33 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
2012-06-20 14:18:46 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s
|
2011-05-03 04:37:08 +08:00
|
|
|
extern void foo(void(^)(void));
|
|
|
|
|
2013-03-22 04:20:15 +08:00
|
|
|
// CHECK: [ DW_TAG_subprogram ] {{.*}} [__destroy_helper_block_]
|
2011-05-03 04:37:08 +08:00
|
|
|
|
|
|
|
@interface NSObject {
|
|
|
|
struct objc_object *isa;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface A:NSObject @end
|
|
|
|
@implementation A
|
|
|
|
- (void) helper {
|
|
|
|
int master = 0;
|
|
|
|
__block int m2 = 0;
|
|
|
|
__block int dbTransaction = 0;
|
|
|
|
int (^x)(void) = ^(void) { (void) self;
|
|
|
|
(void) master;
|
|
|
|
(void) dbTransaction;
|
|
|
|
m2++;
|
|
|
|
return m2;
|
|
|
|
|
|
|
|
};
|
|
|
|
master = x();
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
void foo(void(^x)(void)) {}
|
|
|
|
|