blob: e13cc7d539846b30802cfd1cae04eb7ec510847d [file] [log] [blame]
Tim Northover19ae1172013-08-12 12:51:05 +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 CHECK-LP64 %s
Nico Rieck140db272014-02-16 07:28:32 +00002// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LP32 %s
Fariborz Jahanian989908f2010-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 McCallbf9a86b2011-02-16 00:49:34 +000022// CHECK-LP64: call i8* @objc_read_weak
23// CHECK-LP32: call i8* @objc_read_weak
Fariborz Jahanian989908f2010-02-10 23:34:57 +000024