1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fobjc-gc -triple x86_64-apple-darwin -emit-llvm %s -o %t-64.ll
2 // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.ll %s
4 // See commentary in test/CodeGenObjC/block-var-layout.m, from which
5 // this is largely cloned.
22 extern id opaque_id();
25 __block int byref_int = 0;
30 const id bar = (id) opaque_id();
32 __strong void *strong_void_sta;
33 __block id byref_bab = (id)0;
34 __block void *bl_var1;
38 // byref int, short, char, char, char, id, id, strong void*, byref id
40 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [4 x i8] c"\015\10\00"
42 byref_int = sh + ch+ch1+ch2 ;
45 x((id)strong_void_sta);
51 // byref int, short, char, char, char, id, id, strong void*, byref void*, byref id
53 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [4 x i8] c"\016\10\00"
55 byref_int = sh + ch+ch1+ch2 ;
58 x((id)strong_void_sta);
66 // byref int, short, char, char, char, id, id, byref void*, int, double, byref id
68 // FIXME: we'd get a better format here if we sorted by scannability, not just alignment
69 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\014\11 \00"
71 byref_int = sh + ch+ch1+ch2 ;
82 // struct S (int, id, int, id, int, id)
84 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\01A\11\11\00"
92 // Test 5 (unions/structs and their nesting):
120 // struct s2 (int, id, int, id, int, id?), union u2 (id?)
122 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [6 x i8] c"\01A\11\12p\00"
133 void notifyBlock(id dependentBlock) {
134 id singleObservationToken;
140 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"\013\00"
141 void (^wrapperBlock)() = ^() {
142 CFRelease(singleObservationToken);
143 CFRelease(singleObservationToken);
145 CFRelease(singleObservationToken);
151 void test_empty_block() {
153 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [2 x i8] c"\01\00"
154 void (^wrapperBlock)() = ^() {