annotate clang/test/CodeGenObjCXX/arc-weak.mm @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
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 -fblocks -fobjc-arc -fobjc-runtime-has-weak -std=c++11 -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 __attribute((objc_root_class)) @interface A @end
anatofuz
parents:
diff changeset
4 @interface B : A @end
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // rdar://problem/23559789
anatofuz
parents:
diff changeset
7 // Ensure that type differences don't cause an assert here.
anatofuz
parents:
diff changeset
8 void test0(__weak B **src) {
anatofuz
parents:
diff changeset
9 __weak A *dest = *src;
anatofuz
parents:
diff changeset
10 }
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 // CHECK-LABEL: define{{.*}} void @_Z5test0PU6__weakP1B(
150
anatofuz
parents:
diff changeset
12 // CHECK: [[SRC:%.*]] = alloca [[B:%.*]]**, align 8
anatofuz
parents:
diff changeset
13 // CHECK: [[DEST:%.*]] = alloca [[A:%.*]]*, align 8
anatofuz
parents:
diff changeset
14 // CHECK: [[T0:%.*]] = load [[B]]**, [[B]]*** [[SRC]], align 8
anatofuz
parents:
diff changeset
15 // CHECK-NEXT: [[T1:%.*]] = bitcast [[B]]** [[T0]] to [[A]]**
anatofuz
parents:
diff changeset
16 // CHECK-NEXT: [[T2:%.*]] = bitcast [[A]]** [[DEST]] to i8**
anatofuz
parents:
diff changeset
17 // CHECK-NEXT: [[T3:%.*]] = bitcast [[A]]** [[T1]] to i8**
anatofuz
parents:
diff changeset
18 // CHECK-NEXT: call void @llvm.objc.copyWeak(i8** [[T2]], i8** [[T3]])
anatofuz
parents:
diff changeset
19 // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]** [[DEST]] to i8**
anatofuz
parents:
diff changeset
20 // CHECK: call void @llvm.objc.destroyWeak(i8** [[T0]])
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 void test1(__weak B **src) {
anatofuz
parents:
diff changeset
23 __weak A *dest = static_cast<__weak B*&&>(*src);
anatofuz
parents:
diff changeset
24 }
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
25 // CHECK-LABEL: define{{.*}} void @_Z5test1PU6__weakP1B(
150
anatofuz
parents:
diff changeset
26 // CHECK: [[SRC:%.*]] = alloca [[B:%.*]]**, align 8
anatofuz
parents:
diff changeset
27 // CHECK: [[DEST:%.*]] = alloca [[A:%.*]]*, align 8
anatofuz
parents:
diff changeset
28 // CHECK: [[T0:%.*]] = load [[B]]**, [[B]]*** [[SRC]], align 8
anatofuz
parents:
diff changeset
29 // CHECK-NEXT: [[T1:%.*]] = bitcast [[B]]** [[T0]] to [[A]]**
anatofuz
parents:
diff changeset
30 // CHECK-NEXT: [[T2:%.*]] = bitcast [[A]]** [[DEST]] to i8**
anatofuz
parents:
diff changeset
31 // CHECK-NEXT: [[T3:%.*]] = bitcast [[A]]** [[T1]] to i8**
anatofuz
parents:
diff changeset
32 // CHECK-NEXT: call void @llvm.objc.moveWeak(i8** [[T2]], i8** [[T3]])
anatofuz
parents:
diff changeset
33 // CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]** [[DEST]] to i8**
anatofuz
parents:
diff changeset
34 // CHECK: call void @llvm.objc.destroyWeak(i8** [[T0]])