xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/debug-info-block-helper.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// REQUIRES: x86-registered-target
2f4a2713aSLionel Sambuc// RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s
3f4a2713aSLionel Sambucextern void foo(void(^)(void));
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc// CHECK: [ DW_TAG_subprogram ] {{.*}} [__destroy_helper_block_]
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc@interface NSObject {
8f4a2713aSLionel Sambuc  struct objc_object *isa;
9f4a2713aSLionel Sambuc}
10f4a2713aSLionel Sambuc@end
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc@interface A:NSObject @end
13f4a2713aSLionel Sambuc@implementation A
14f4a2713aSLionel Sambuc- (void) helper {
15f4a2713aSLionel Sambuc int master = 0;
16f4a2713aSLionel Sambuc __block int m2 = 0;
17f4a2713aSLionel Sambuc __block int dbTransaction = 0;
18f4a2713aSLionel Sambuc int (^x)(void) = ^(void) { (void) self;
19f4a2713aSLionel Sambuc	(void) master;
20f4a2713aSLionel Sambuc	(void) dbTransaction;
21f4a2713aSLionel Sambuc	m2++;
22f4a2713aSLionel Sambuc	return m2;
23f4a2713aSLionel Sambuc
24f4a2713aSLionel Sambuc	};
25f4a2713aSLionel Sambuc  master = x();
26f4a2713aSLionel Sambuc}
27f4a2713aSLionel Sambuc@end
28f4a2713aSLionel Sambuc
29f4a2713aSLionel Sambucvoid foo(void(^x)(void)) {}
30f4a2713aSLionel Sambuc
31