252
|
1 // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-10.7 -emit-llvm -o - | FileCheck %s
|
|
2 // RUN: %clang_cc1 %s -triple x86_64-unknown-freebsd -fobjc-runtime=gnustep-1.7 -emit-llvm -o - | FileCheck -check-prefix=CHECK-GNUSTEP %s
|
150
|
3 // rdar://6137845
|
|
4
|
|
5 extern int DEFAULT();
|
|
6
|
|
7 struct TCPPObject
|
|
8 {
|
|
9 TCPPObject();
|
|
10 ~TCPPObject();
|
|
11 TCPPObject(const TCPPObject& inObj, int i = DEFAULT());
|
|
12 TCPPObject& operator=(const TCPPObject& inObj);
|
|
13 int filler[64];
|
|
14 };
|
|
15
|
|
16
|
|
17 @interface MyDocument
|
|
18 {
|
|
19 @private
|
|
20 TCPPObject _cppObject;
|
|
21 TCPPObject _cppObject1;
|
|
22 }
|
|
23 @property (assign, readwrite, atomic) const TCPPObject MyProperty;
|
|
24 @property (assign, readwrite, atomic) const TCPPObject MyProperty1;
|
|
25 @end
|
|
26
|
|
27 @implementation MyDocument
|
|
28 @synthesize MyProperty = _cppObject;
|
|
29 @synthesize MyProperty1 = _cppObject1;
|
|
30 @end
|
|
31
|
252
|
32 // CHECK-LABEL: define internal void @__copy_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #
|
|
33 // CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 8
|
|
34 // CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 8
|
236
|
35 // CHECK: [[CALL:%.*]] = call noundef i32 @_Z7DEFAULTv()
|
252
|
36 // CHECK: call void @_ZN10TCPPObjectC1ERKS_i(ptr {{[^,]*}} [[TWO]], ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[THREE]], i32 noundef [[CALL]])
|
150
|
37 // CHECK: ret void
|
|
38
|
|
39 // CHECK: define internal void @"\01-[MyDocument MyProperty]"(
|
252
|
40 // CHECK: call void @objc_copyCppObjectAtomic(ptr noundef [[AGGRESULT:%.*]], ptr noundef [[ADDPTR:%.*]], ptr noundef @__copy_helper_atomic_property_)
|
150
|
41 // CHECK: ret void
|
|
42
|
252
|
43 // CHECK-LABEL: define internal void @__assign_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #
|
|
44 // CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 8
|
|
45 // CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 8
|
|
46 // CHECK: [[CALL:%.*]] = call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN10TCPPObjectaSERKS_(ptr {{[^,]*}} [[TWO]], ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[THREE]])
|
150
|
47 // CHECK: ret void
|
|
48
|
|
49 // CHECK: define internal void @"\01-[MyDocument setMyProperty:]"(
|
252
|
50 // CHECK: call void @objc_copyCppObjectAtomic(ptr noundef [[ADDRPTR:%.*]], ptr noundef [[MYPROPERTY:%.*]], ptr noundef @__assign_helper_atomic_property_)
|
150
|
51 // CHECK: ret void
|
|
52
|
|
53 // CHECK-GNUSTEP: objc_getCppObjectAtomic
|
|
54 // CHECK-GNUSTEP: objc_setCppObjectAtomic
|