comparison clang/test/CodeGenObjC/arc-i386.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
1 // RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s 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 2 // RUN: %clang_cc1 -triple i386-apple-iossimulator6.0 -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
3 3
4 // <rdar://24531556>: implement objc_retainAutoreleasedReturnValue on i386 4 // <rdar://24531556>: implement objc_retainAutoreleasedReturnValue on i386
5 5
6 // CHECK-LABEL: define i8* @test0() 6 // CHECK-LABEL: define{{.*}} i8* @test0()
7 id test0(void) { 7 id test0(void) {
8 extern id test0_helper(void); 8 extern id test0_helper(void);
9 // CHECK: [[T0:%.*]] = call i8* @test0_helper() 9 // CHECK: [[T0:%.*]] = call i8* @test0_helper()
10 // CHECK-NEXT: ret i8* [[T0]] 10 // CHECK-NEXT: ret i8* [[T0]]
11 return test0_helper(); 11 return test0_helper();
12 } 12 }
13 13
14 // CHECK-LABEL: define void @test1() 14 // CHECK-LABEL: define{{.*}} void @test1()
15 void test1(void) { 15 void test1(void) {
16 extern id test1_helper(void); 16 extern id test1_helper(void);
17 // CHECK: [[T0:%.*]] = call i8* @test1_helper() 17 // CHECK: [[T0:%.*]] = call i8* @test1_helper()
18 // CHECK-NEXT: call void asm sideeffect "mov 18 // CHECK-NEXT: call void asm sideeffect "mov
19 // CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]]) 19 // CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
31 // CHECK: [[T0:%.*]] = call [[A:%.*]]* @test2_helper() 31 // CHECK: [[T0:%.*]] = call [[A:%.*]]* @test2_helper()
32 // CHECK-NEXT: ret [[A]]* [[T0]] 32 // CHECK-NEXT: ret [[A]]* [[T0]]
33 return test2_helper(); 33 return test2_helper();
34 } 34 }
35 35
36 // CHECK-LABEL: define i8* @test3() 36 // CHECK-LABEL: define{{.*}} i8* @test3()
37 id test3(void) { 37 id test3(void) {
38 extern A *test3_helper(void); 38 extern A *test3_helper(void);
39 // CHECK: [[T0:%.*]] = call [[A]]* @test3_helper() 39 // CHECK: [[T0:%.*]] = call [[A]]* @test3_helper()
40 // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8* 40 // CHECK-NEXT: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8*
41 // CHECK-NEXT: ret i8* [[T1]] 41 // CHECK-NEXT: ret i8* [[T1]]