annotate clang/test/CodeGenObjCXX/property-object-reference-2.mm @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 0572611fdcc8
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-10.7 -emit-llvm -o - | FileCheck %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 %s -triple x86_64-unknown-freebsd -fobjc-runtime=gnustep-1.7 -emit-llvm -o - | FileCheck -check-prefix=CHECK-GNUSTEP %s
anatofuz
parents:
diff changeset
3 // rdar://6137845
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 extern int DEFAULT();
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 struct TCPPObject
anatofuz
parents:
diff changeset
8 {
anatofuz
parents:
diff changeset
9 TCPPObject();
anatofuz
parents:
diff changeset
10 ~TCPPObject();
anatofuz
parents:
diff changeset
11 TCPPObject(const TCPPObject& inObj, int i = DEFAULT());
anatofuz
parents:
diff changeset
12 TCPPObject& operator=(const TCPPObject& inObj);
anatofuz
parents:
diff changeset
13 int filler[64];
anatofuz
parents:
diff changeset
14 };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 @interface MyDocument
anatofuz
parents:
diff changeset
18 {
anatofuz
parents:
diff changeset
19 @private
anatofuz
parents:
diff changeset
20 TCPPObject _cppObject;
anatofuz
parents:
diff changeset
21 TCPPObject _cppObject1;
anatofuz
parents:
diff changeset
22 }
anatofuz
parents:
diff changeset
23 @property (assign, readwrite, atomic) const TCPPObject MyProperty;
anatofuz
parents:
diff changeset
24 @property (assign, readwrite, atomic) const TCPPObject MyProperty1;
anatofuz
parents:
diff changeset
25 @end
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 @implementation MyDocument
anatofuz
parents:
diff changeset
28 @synthesize MyProperty = _cppObject;
anatofuz
parents:
diff changeset
29 @synthesize MyProperty1 = _cppObject1;
anatofuz
parents:
diff changeset
30 @end
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 // CHECK-LABEL: define internal void @__copy_helper_atomic_property_(%struct.TCPPObject* %0, %struct.TCPPObject* %1) #
anatofuz
parents:
diff changeset
33 // CHECK: [[TWO:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR:%.*]], align 8
anatofuz
parents:
diff changeset
34 // CHECK: [[THREE:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR1:%.*]], align 8
anatofuz
parents:
diff changeset
35 // CHECK: [[CALL:%.*]] = call i32 @_Z7DEFAULTv()
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
36 // CHECK: call void @_ZN10TCPPObjectC1ERKS_i(%struct.TCPPObject* {{[^,]*}} [[TWO]], %struct.TCPPObject* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[THREE]], i32 [[CALL]])
150
anatofuz
parents:
diff changeset
37 // CHECK: ret void
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 // CHECK: define internal void @"\01-[MyDocument MyProperty]"(
anatofuz
parents:
diff changeset
40 // CHECK: [[ONE:%.*]] = bitcast i8* [[ADDPTR:%.*]] to %struct.TCPPObject*
anatofuz
parents:
diff changeset
41 // CHECK: [[TWO:%.*]] = bitcast %struct.TCPPObject* [[ONE]] to i8*
anatofuz
parents:
diff changeset
42 // CHECK: [[THREE:%.*]] = bitcast %struct.TCPPObject* [[AGGRESULT:%.*]] to i8*
anatofuz
parents:
diff changeset
43 // CHECK: call void @objc_copyCppObjectAtomic(i8* [[THREE]], i8* [[TWO]], i8* bitcast (void (%struct.TCPPObject*, %struct.TCPPObject*)* @__copy_helper_atomic_property_ to i8*))
anatofuz
parents:
diff changeset
44 // CHECK: ret void
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // CHECK-LABEL: define internal void @__assign_helper_atomic_property_(%struct.TCPPObject* %0, %struct.TCPPObject* %1) #
anatofuz
parents:
diff changeset
47 // CHECK: [[THREE:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR1:%.*]], align 8
anatofuz
parents:
diff changeset
48 // CHECK: [[TWO:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR:%.*]], align 8
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
49 // CHECK: [[CALL:%.*]] = call nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %struct.TCPPObject* @_ZN10TCPPObjectaSERKS_(%struct.TCPPObject* {{[^,]*}} [[TWO]], %struct.TCPPObject* nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[THREE]])
150
anatofuz
parents:
diff changeset
50 // CHECK: ret void
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 // CHECK: define internal void @"\01-[MyDocument setMyProperty:]"(
anatofuz
parents:
diff changeset
53 // CHECK: [[ONE:%.*]] = bitcast i8* [[ADDRPTR:%.*]] to %struct.TCPPObject*
anatofuz
parents:
diff changeset
54 // CHECK: [[TWO:%.*]] = bitcast %struct.TCPPObject* [[ONE]] to i8*
anatofuz
parents:
diff changeset
55 // CHECK: [[THREE:%.*]] = bitcast %struct.TCPPObject* [[MYPROPERTY:%.*]] to i8*
anatofuz
parents:
diff changeset
56 // CHECK: call void @objc_copyCppObjectAtomic(i8* [[TWO]], i8* [[THREE]], i8* bitcast (void (%struct.TCPPObject*, %struct.TCPPObject*)* @__assign_helper_atomic_property_ to i8*))
anatofuz
parents:
diff changeset
57 // CHECK: ret void
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 // CHECK-GNUSTEP: objc_getCppObjectAtomic
anatofuz
parents:
diff changeset
60 // CHECK-GNUSTEP: objc_setCppObjectAtomic