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
10 extern id opaque_id(void);
13 __block int byref_int = 0;
14 const id bar = (id) opaque_id();
16 __strong id strong_void_sta;
17 __block id byref_bab = (id)0;
20 // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0
25 // CHECK: Inline block variable layout: 0x0210, BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0
32 // CHECK: Inline block variable layout: 0x0230, BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0
41 // CHECK: Inline block variable layout: 0x0231, BL_STRONG:2, BL_BYREF:3, BL_WEAK:1, BL_OPERATOR:0
52 // CHECK: Inline block variable layout: 0x0235, BL_STRONG:2, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0
53 __weak id wid1, wid2, wid3, wid4;
67 // CHECK: Inline block variable layout: 0x035, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0
79 // CHECK: Inline block variable layout: 0x01, BL_WEAK:1, BL_OPERATOR:0
84 // CHECK: Inline block variable layout: 0x020, BL_BYREF:2, BL_OPERATOR:0
90 // CHECK: Inline block variable layout: 0x0102, BL_STRONG:1, BL_WEAK:2, BL_OPERATOR:0
100 extern void NSLog(NSString *format, ...);
101 typedef void (^dispatch_block_t)(void);
103 __strong NSString *s1 = 0;
104 __strong NSString *s2 = 0;
105 __weak NSString *w1 = 0;
108 // CHECK: Inline block variable layout: 0x0201, BL_STRONG:2, BL_WEAK:1, BL_OPERATOR:0
109 dispatch_block_t block2 = ^{
110 NSLog(@"%@, %@, %@", s1, w1, s2);