annotate clang/test/CodeGenObjC/arc-weak-property.m @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +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-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
2 // rdar://8899430
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @interface WeakPropertyTest {
anatofuz
parents:
diff changeset
5 __weak id PROP;
anatofuz
parents:
diff changeset
6 }
anatofuz
parents:
diff changeset
7 @property () __weak id PROP;
anatofuz
parents:
diff changeset
8 @end
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 @implementation WeakPropertyTest
anatofuz
parents:
diff changeset
11 @synthesize PROP;
anatofuz
parents:
diff changeset
12 @end
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // CHECK: define internal i8* @"\01-[WeakPropertyTest PROP]"
anatofuz
parents:
diff changeset
15 // CHECK: [[SELF:%.*]] = alloca [[WPT:%.*]]*,
anatofuz
parents:
diff changeset
16 // CHECK-NEXT: [[CMD:%.*]] = alloca i8*,
anatofuz
parents:
diff changeset
17 // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
18 // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]]
anatofuz
parents:
diff changeset
19 // CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
20 // CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP"
anatofuz
parents:
diff changeset
21 // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8*
anatofuz
parents:
diff changeset
22 // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]]
anatofuz
parents:
diff changeset
23 // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8**
anatofuz
parents:
diff changeset
24 // CHECK-NEXT: [[T5:%.*]] = call i8* @llvm.objc.loadWeakRetained(i8** [[T4]])
anatofuz
parents:
diff changeset
25 // CHECK-NEXT: [[T6:%.*]] = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* [[T5]])
anatofuz
parents:
diff changeset
26 // CHECK-NEXT: ret i8* [[T6]]
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 // CHECK: define internal void @"\01-[WeakPropertyTest setPROP:]"
anatofuz
parents:
diff changeset
29 // CHECK: [[SELF:%.*]] = alloca [[WPT:%.*]]*,
anatofuz
parents:
diff changeset
30 // CHECK-NEXT: [[CMD:%.*]] = alloca i8*,
anatofuz
parents:
diff changeset
31 // CHECK-NEXT: [[PROP:%.*]] = alloca i8*,
anatofuz
parents:
diff changeset
32 // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
33 // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]]
anatofuz
parents:
diff changeset
34 // CHECK-NEXT: store i8* {{%.*}}, i8** [[PROP]]
anatofuz
parents:
diff changeset
35 // CHECK-NEXT: [[V:%.*]] = load i8*, i8** [[PROP]]
anatofuz
parents:
diff changeset
36 // CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
37 // CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP"
anatofuz
parents:
diff changeset
38 // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8*
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]]
anatofuz
parents:
diff changeset
40 // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8**
anatofuz
parents:
diff changeset
41 // CHECK-NEXT: call i8* @llvm.objc.storeWeak(i8** [[T4]], i8* [[V]])
anatofuz
parents:
diff changeset
42 // CHECK-NEXT: ret void
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 // CHECK: define internal void @"\01-[WeakPropertyTest .cxx_destruct]"
anatofuz
parents:
diff changeset
45 // CHECK: [[SELF:%.*]] = alloca [[WPT:%.*]]*,
anatofuz
parents:
diff changeset
46 // CHECK-NEXT: [[CMD:%.*]] = alloca i8*,
anatofuz
parents:
diff changeset
47 // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
48 // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]]
anatofuz
parents:
diff changeset
49 // CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]]
anatofuz
parents:
diff changeset
50 // CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP"
anatofuz
parents:
diff changeset
51 // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8*
anatofuz
parents:
diff changeset
52 // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]]
anatofuz
parents:
diff changeset
53 // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8**
anatofuz
parents:
diff changeset
54 // CHECK-NEXT: call void @llvm.objc.destroyWeak(i8** [[T4]])
anatofuz
parents:
diff changeset
55 // CHECK-NEXT: ret void