1 // RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
2 // RUN: FileCheck --input-file=%t-64.layout %s
3 // RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
4 // RUN: FileCheck --input-file=%t-32.layout %s
9 extern id opaque_id(void);
12 __block int byref_int = 0;
13 const id bar = (id) opaque_id();
15 __strong id strong_void_sta;
16 __block id byref_bab = (id)0;
19 // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0
24 // CHECK: Inline block variable layout: 0x0210, BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0
31 // CHECK: Inline block variable layout: 0x0230, BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0
40 // CHECK: Inline block variable layout: 0x0231, BL_STRONG:2, BL_BYREF:3, BL_WEAK:1, BL_OPERATOR:0
51 // CHECK: Inline block variable layout: 0x0235, BL_STRONG:2, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0
52 __weak id wid1, wid2, wid3, wid4;
66 // CHECK: Inline block variable layout: 0x035, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0
78 // CHECK: Inline block variable layout: 0x01, BL_WEAK:1, BL_OPERATOR:0
83 // CHECK: Inline block variable layout: 0x020, BL_BYREF:2, BL_OPERATOR:0
89 // CHECK: Inline block variable layout: 0x0102, BL_STRONG:1, BL_WEAK:2, BL_OPERATOR:0
98 extern void NSLog(NSString *format, ...);
99 typedef void (^dispatch_block_t)(void);
101 __strong NSString *s1 = 0;
102 __strong NSString *s2 = 0;
103 __weak NSString *w1 = 0;
106 // CHECK: Inline block variable layout: 0x0201, BL_STRONG:2, BL_WEAK:1, BL_OPERATOR:0
107 dispatch_block_t block2 = ^{
108 NSLog(@"%@, %@, %@", s1, w1, s2);