1 // RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple i386-apple-iossimulator6.0 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
4 // implement objc_retainAutoreleasedReturnValue on i386
6 // CHECK-LABEL: define{{.*}} ptr @test0()
8 extern id test0_helper(void);
9 // CHECK: [[T0:%.*]] = call ptr @test0_helper()
10 // CHECK-NEXT: ret ptr [[T0]]
11 return test0_helper();
14 // CHECK-LABEL: define{{.*}} void @test1()
16 extern id test1_helper(void);
17 // CHECK: [[T0:%.*]] = call ptr @test1_helper()
18 // CHECK-NEXT: call void asm sideeffect "mov
19 // CHECK-NEXT: [[T1:%.*]] = call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr [[T0]])
20 // CHECK-NEXT: store ptr [[T1]],
21 // CHECK-NEXT: call void @llvm.objc.storeStrong(
22 // CHECK-NEXT: ret void
23 id x = test1_helper();
26 // CHECK-LABEL: define {{.*}} @test2()
29 extern A *test2_helper(void);
30 // CHECK: [[T0:%.*]] = call ptr @test2_helper()
31 // CHECK-NEXT: ret ptr [[T0]]
32 return test2_helper();
35 // CHECK-LABEL: define{{.*}} ptr @test3()
37 extern A *test3_helper(void);
38 // CHECK: [[T0:%.*]] = call ptr @test3_helper()
39 // CHECK-NEXT: ret ptr [[T0]]
40 return test3_helper();