John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 2 | |
| 3 | id 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 | |
| 10 | void 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 McCall | 015f33b | 2012-10-17 02:28:37 +0000 | [diff] [blame] | 16 | // CHECK-NEXT: call void @objc_storeStrong( |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 17 | // CHECK-NEXT: ret void |
| 18 | id x = test1_helper(); |
| 19 | } |
John McCall | f9fdcc0 | 2012-09-07 23:30:50 +0000 | [diff] [blame] | 20 | |
| 21 | // rdar://problem/12133032 |
| 22 | @class A; |
| 23 | A *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 | |
| 30 | id 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 | } |