1 // RUN: %clang_cc1 -no-opaque-pointers -triple armv7-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -no-opaque-pointers -triple arm64-apple-ios -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
4 // <rdar://12438598>: use an autorelease marker on ARM64.
7 extern id test0_helper(void);
8 // CHECK: [[T0:%.*]] = call [[CC:(arm_aapcscc )?]]i8* @test0_helper()
9 // CHECK-NEXT: ret i8* [[T0]]
10 return test0_helper();
14 extern id test1_helper(void);
15 // CHECK: [[T0:%.*]] = call [[CC]]i8* @test1_helper()
16 // CHECK-NEXT: call void asm sideeffect "mov\09{{fp, fp|r7, r7}}\09\09// marker for objc_retainAutoreleaseReturnValue"
17 // CHECK-NEXT: [[T1:%.*]] = call [[CC]]i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
18 // CHECK-NEXT: store i8* [[T1]],
19 // CHECK-NEXT: call [[CC]]void @llvm.objc.storeStrong(
20 // CHECK-NEXT: ret void
21 id x = test1_helper();
24 // rdar://problem/12133032
27 extern A *test2_helper(void);
28 // CHECK: [[T0:%.*]] = call [[CC]][[A:%.*]]* @test2_helper()
29 // CHECK-NEXT: ret [[A]]* [[T0]]
30 return test2_helper();
34 extern A *test3_helper(void);
35 // CHECK: [[T0:%.*]] = call [[CC]][[A:%.*]]* @test3_helper()
36 // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8*
37 // CHECK-NEXT: ret i8* [[T1]]
38 return test3_helper();