annotate clang/test/CodeGenObjC/arc-exceptions.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime-has-weak -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 @class Ety;
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // These first two tests are all PR11732 / rdar://problem/10667070.
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 void test0_helper(void);
anatofuz
parents:
diff changeset
8 void test0(void) {
anatofuz
parents:
diff changeset
9 @try {
anatofuz
parents:
diff changeset
10 test0_helper();
anatofuz
parents:
diff changeset
11 } @catch (Ety *e) {
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13 }
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
14 // CHECK-LABEL: define{{.*}} void @test0()
150
anatofuz
parents:
diff changeset
15 // CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
anatofuz
parents:
diff changeset
16 // CHECK-NEXT: invoke void @test0_helper()
anatofuz
parents:
diff changeset
17 // CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
anatofuz
parents:
diff changeset
18 // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[ETY]]*
anatofuz
parents:
diff changeset
19 // CHECK-NEXT: [[T2:%.*]] = bitcast [[ETY]]* [[T1]] to i8*
anatofuz
parents:
diff changeset
20 // CHECK-NEXT: [[T3:%.*]] = call i8* @llvm.objc.retain(i8* [[T2]]) [[NUW:#[0-9]+]]
anatofuz
parents:
diff changeset
21 // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[ETY]]*
anatofuz
parents:
diff changeset
22 // CHECK-NEXT: store [[ETY]]* [[T4]], [[ETY]]** [[E]]
anatofuz
parents:
diff changeset
23 // CHECK-NEXT: [[T0:%.*]] = bitcast [[ETY]]** [[E]] to i8**
anatofuz
parents:
diff changeset
24 // CHECK-NEXT: call void @llvm.objc.storeStrong(i8** [[T0]], i8* null) [[NUW]]
anatofuz
parents:
diff changeset
25 // CHECK-NEXT: call void @objc_end_catch() [[NUW]]
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 void test1_helper(void);
anatofuz
parents:
diff changeset
28 void test1(void) {
anatofuz
parents:
diff changeset
29 @try {
anatofuz
parents:
diff changeset
30 test1_helper();
anatofuz
parents:
diff changeset
31 } @catch (__weak Ety *e) {
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33 }
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 // CHECK-LABEL: define{{.*}} void @test1()
150
anatofuz
parents:
diff changeset
35 // CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
anatofuz
parents:
diff changeset
36 // CHECK-NEXT: invoke void @test1_helper()
anatofuz
parents:
diff changeset
37 // CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
anatofuz
parents:
diff changeset
38 // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[ETY]]*
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: [[T2:%.*]] = bitcast [[ETY]]** [[E]] to i8**
anatofuz
parents:
diff changeset
40 // CHECK-NEXT: [[T3:%.*]] = bitcast [[ETY]]* [[T1]] to i8*
anatofuz
parents:
diff changeset
41 // CHECK-NEXT: call i8* @llvm.objc.initWeak(i8** [[T2]], i8* [[T3]]) [[NUW]]
anatofuz
parents:
diff changeset
42 // CHECK-NEXT: [[T0:%.*]] = bitcast [[ETY]]** [[E]] to i8**
anatofuz
parents:
diff changeset
43 // CHECK-NEXT: call void @llvm.objc.destroyWeak(i8** [[T0]]) [[NUW]]
anatofuz
parents:
diff changeset
44 // CHECK-NEXT: call void @objc_end_catch() [[NUW]]
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // CHECK: attributes [[NUW]] = { nounwind }