llvm-project
37 строк · 1.2 Кб
1// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
2// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
3
4// use an autorelease marker on ARM64.
5
6id test0(void) {
7extern id test0_helper(void);
8// CHECK: [[T0:%.*]] = call [[CC:(arm_aapcscc )?]]ptr @test0_helper()
9// CHECK-NEXT: ret ptr [[T0]]
10return test0_helper();
11}
12
13void test1(void) {
14extern id test1_helper(void);
15// CHECK: [[T0:%.*]] = call [[CC]]ptr @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]]ptr @llvm.objc.retainAutoreleasedReturnValue(ptr [[T0]])
18// CHECK-NEXT: store ptr [[T1]],
19// CHECK-NEXT: call [[CC]]void @llvm.objc.storeStrong(
20// CHECK-NEXT: ret void
21id x = test1_helper();
22}
23
24@class A;
25A *test2(void) {
26extern A *test2_helper(void);
27// CHECK: [[T0:%.*]] = call [[CC]]ptr @test2_helper()
28// CHECK-NEXT: ret ptr [[T0]]
29return test2_helper();
30}
31
32id test3(void) {
33extern A *test3_helper(void);
34// CHECK: [[T0:%.*]] = call [[CC]]ptr @test3_helper()
35// CHECK-NEXT: ret ptr [[T0]]
36return test3_helper();
37}
38