John McCall | 9b0a7ce | 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 |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s |
| 3 | |
| 4 | // <rdar://12438598>: use an autorelease marker on ARM64. |
John McCall | 31168b0 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 5 | |
| 6 | id test0(void) { |
| 7 | extern id test0_helper(void); |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 8 | // CHECK: [[T0:%.*]] = call [[CC:(arm_aapcscc )?]]i8* @test0_helper() |
John McCall | 31168b0 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 9 | // CHECK-NEXT: ret i8* [[T0]] |
| 10 | return test0_helper(); |
| 11 | } |
| 12 | |
| 13 | void test1(void) { |
| 14 | extern id test1_helper(void); |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 15 | // CHECK: [[T0:%.*]] = call [[CC]]i8* @test1_helper() |
| 16 | // CHECK-NEXT: call void asm sideeffect "mov |
| 17 | // CHECK-NEXT: [[T1:%.*]] = call [[CC]]i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) |
John McCall | 31168b0 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 18 | // CHECK-NEXT: store i8* [[T1]], |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 19 | // CHECK-NEXT: call [[CC]]void @objc_storeStrong( |
John McCall | 31168b0 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 20 | // CHECK-NEXT: ret void |
| 21 | id x = test1_helper(); |
| 22 | } |
John McCall | cfa4e9b | 2012-09-07 23:30:50 +0000 | [diff] [blame] | 23 | |
| 24 | // rdar://problem/12133032 |
| 25 | @class A; |
| 26 | A *test2(void) { |
| 27 | extern A *test2_helper(void); |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 28 | // CHECK: [[T0:%.*]] = call [[CC]][[A:%.*]]* @test2_helper() |
John McCall | cfa4e9b | 2012-09-07 23:30:50 +0000 | [diff] [blame] | 29 | // CHECK-NEXT: ret [[A]]* [[T0]] |
| 30 | return test2_helper(); |
| 31 | } |
| 32 | |
| 33 | id test3(void) { |
| 34 | extern A *test3_helper(void); |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 35 | // CHECK: [[T0:%.*]] = call [[CC]][[A:%.*]]* @test3_helper() |
John McCall | cfa4e9b | 2012-09-07 23:30:50 +0000 | [diff] [blame] | 36 | // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8* |
| 37 | // CHECK-NEXT: ret i8* [[T1]] |
| 38 | return test3_helper(); |
| 39 | } |