blob: 25434947d10429427e438a492b7095e9d85669a9 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s
2// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s
Fariborz Jahanian263c4de2010-02-10 23:34:57 +00003
4@interface MyView
5- (void)MyView_sharedInit;
6@end
7
8void foo(MyView *(^obj)(void)) ;
9
10@implementation MyView
11- (void)MyView_sharedInit {
12
13 __block __weak MyView *weakSelf = self;
14 foo(
15 ^{
16 return weakSelf;
17 });
18
19}
20@end
21
John McCallc20e2042011-02-16 00:49:34 +000022// CHECK-LP64: call i8* @objc_read_weak
23// CHECK-LP32: call i8* @objc_read_weak
Fariborz Jahanian263c4de2010-02-10 23:34:57 +000024