blob: 2ab8cb6ef562dd9ddb164768d148a7709ce0f8be [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
John McCallf85e1932011-06-15 23:02:42 +00002
3id test0(void) {
4 extern id test0_helper(void);
5 // CHECK: [[T0:%.*]] = call arm_aapcscc i8* @test0_helper()
6 // CHECK-NEXT: ret i8* [[T0]]
7 return test0_helper();
8}
9
10void test1(void) {
11 extern id test1_helper(void);
12 // CHECK: [[T0:%.*]] = call arm_aapcscc i8* @test1_helper()
13 // CHECK-NEXT: call void asm sideeffect "mov\09r7, r7
14 // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
15 // CHECK-NEXT: store i8* [[T1]],
John McCall015f33b2012-10-17 02:28:37 +000016 // CHECK-NEXT: call void @objc_storeStrong(
John McCallf85e1932011-06-15 23:02:42 +000017 // CHECK-NEXT: ret void
18 id x = test1_helper();
19}
John McCallf9fdcc02012-09-07 23:30:50 +000020
21// rdar://problem/12133032
22@class A;
23A *test2(void) {
24 extern A *test2_helper(void);
25 // CHECK: [[T0:%.*]] = call arm_aapcscc [[A:%.*]]* @test2_helper()
26 // CHECK-NEXT: ret [[A]]* [[T0]]
27 return test2_helper();
28}
29
30id test3(void) {
31 extern A *test3_helper(void);
32 // CHECK: [[T0:%.*]] = call arm_aapcscc [[A:%.*]]* @test3_helper()
33 // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8*
34 // CHECK-NEXT: ret i8* [[T1]]
35 return test3_helper();
36}