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
10 TCPPObject(const TCPPObject& inObj, int i = DEFAULT());
11 TCPPObject& operator=(const TCPPObject& inObj);
19 TCPPObject _cppObject;
20 TCPPObject _cppObject1;
22 @property (assign, readwrite, atomic) const TCPPObject MyProperty;
23 @property (assign, readwrite, atomic) const TCPPObject MyProperty1;
26 @implementation MyDocument
27 @synthesize MyProperty = _cppObject;
28 @synthesize MyProperty1 = _cppObject1;
31 // CHECK-LABEL: define internal void @__copy_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #
32 // CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 8
33 // CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 8
34 // CHECK: [[CALL:%.*]] = call noundef i32 @_Z7DEFAULTv()
35 // CHECK: call void @_ZN10TCPPObjectC1ERKS_i(ptr {{[^,]*}} [[TWO]], ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[THREE]], i32 noundef [[CALL]])
38 // CHECK: define internal void @"\01-[MyDocument MyProperty]"(
39 // CHECK: call void @objc_copyCppObjectAtomic(ptr noundef [[AGGRESULT:%.*]], ptr noundef [[ADDPTR:%.*]], ptr noundef @__copy_helper_atomic_property_)
42 // CHECK-LABEL: define internal void @__assign_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #
43 // CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 8
44 // CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 8
45 // 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]])
48 // CHECK: define internal void @"\01-[MyDocument setMyProperty:]"(
49 // CHECK: call void @objc_copyCppObjectAtomic(ptr noundef [[ADDRPTR:%.*]], ptr noundef [[MYPROPERTY:%.*]], ptr noundef @__assign_helper_atomic_property_)
52 // CHECK-GNUSTEP: objc_getCppObjectAtomic
53 // CHECK-GNUSTEP: objc_setCppObjectAtomic