54 lines · plain
1// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-10.7 -emit-llvm -o - | FileCheck %s2// RUN: %clang_cc1 %s -triple x86_64-unknown-freebsd -fobjc-runtime=gnustep-1.7 -emit-llvm -o - | FileCheck -check-prefix=CHECK-GNUSTEP %s3 4extern int DEFAULT();5 6struct TCPPObject7{8 TCPPObject();9 ~TCPPObject();10 TCPPObject(const TCPPObject& inObj, int i = DEFAULT());11 TCPPObject& operator=(const TCPPObject& inObj);12 int filler[64];13};14 15 16@interface MyDocument 17{18@private19 TCPPObject _cppObject;20 TCPPObject _cppObject1;21}22@property (assign, readwrite, atomic) const TCPPObject MyProperty;23@property (assign, readwrite, atomic) const TCPPObject MyProperty1;24@end25 26@implementation MyDocument27 @synthesize MyProperty = _cppObject;28 @synthesize MyProperty1 = _cppObject1;29@end30 31// CHECK-LABEL: define internal void @__copy_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #32// CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 833// CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 834// 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]])36// CHECK: ret void37 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_)40// CHECK: ret void41 42// CHECK-LABEL: define internal void @__assign_helper_atomic_property_(ptr noundef %0, ptr noundef %1) #43// CHECK: [[THREE:%.*]] = load ptr, ptr [[ADDR1:%.*]], align 844// CHECK: [[TWO:%.*]] = load ptr, ptr [[ADDR:%.*]], align 845// 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]])46// CHECK: ret void47 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_)50// CHECK: ret void51 52// CHECK-GNUSTEP: objc_getCppObjectAtomic53// CHECK-GNUSTEP: objc_setCppObjectAtomic54