xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjCXX/property-object-reference-1.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ %s -triple x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc// rdar://6137845
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambucstruct TCPPObject
5*f4a2713aSLionel Sambuc{
6*f4a2713aSLionel Sambuc TCPPObject(const TCPPObject& inObj);
7*f4a2713aSLionel Sambuc TCPPObject();
8*f4a2713aSLionel Sambuc ~TCPPObject();
9*f4a2713aSLionel Sambuc int filler[64];
10*f4a2713aSLionel Sambuc};
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc@interface MyDocument
14*f4a2713aSLionel Sambuc{
15*f4a2713aSLionel Sambuc@private
16*f4a2713aSLionel Sambuc TCPPObject _cppObject;
17*f4a2713aSLionel Sambuc}
18*f4a2713aSLionel Sambuc@property (atomic, assign, readwrite) const TCPPObject& cppObject;
19*f4a2713aSLionel Sambuc@end
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc@implementation MyDocument
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc@synthesize cppObject = _cppObject;
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc@end
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc// CHECK: [[cppObjectaddr:%.*]] = alloca %struct.TCPPObject*, align 8
28*f4a2713aSLionel Sambuc// CHECK: store %struct.TCPPObject* [[cppObject:%.*]], %struct.TCPPObject** [[cppObjectaddr]], align 8
29*f4a2713aSLionel Sambuc// CHECK:  [[THREE:%.*]] = load %struct.TCPPObject** [[cppObjectaddr]], align 8
30*f4a2713aSLionel Sambuc// CHECK:  [[FOUR:%.*]] = bitcast %struct.TCPPObject* [[THREE]] to i8*
31*f4a2713aSLionel Sambuc// CHECK:  call void @objc_copyStruct(i8* [[TWO:%.*]], i8* [[FOUR]], i64 256, i1 zeroext true, i1 zeroext false)
32