xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjCXX/property-dot-copy.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc// rdar://8427922
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambucstruct Vector3D
5*f4a2713aSLionel Sambuc{
6*f4a2713aSLionel Sambuc		float x, y, z;
7*f4a2713aSLionel Sambuc		Vector3D();
8*f4a2713aSLionel Sambuc		Vector3D(const Vector3D &inVector);
9*f4a2713aSLionel Sambuc		Vector3D(float initX, float initY, float initZ);
10*f4a2713aSLionel Sambuc		Vector3D &operator=(const Vector3D & rhs);
11*f4a2713aSLionel Sambuc};
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc@interface Object3D
14*f4a2713aSLionel Sambuc{
15*f4a2713aSLionel Sambuc	Vector3D position;
16*f4a2713aSLionel Sambuc        Vector3D length;
17*f4a2713aSLionel Sambuc}
18*f4a2713aSLionel Sambuc@property (assign) Vector3D position;
19*f4a2713aSLionel Sambuc- (Vector3D) length;
20*f4a2713aSLionel Sambuc- (void) setLength: (Vector3D)arg;
21*f4a2713aSLionel Sambuc@end
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambucint main ()
24*f4a2713aSLionel Sambuc{
25*f4a2713aSLionel Sambuc	Object3D *myObject;
26*f4a2713aSLionel Sambuc        Vector3D V3D(1.0f, 1.0f, 1.0f);
27*f4a2713aSLionel Sambuc// CHECK: call void @_ZN8Vector3DC1ERKS_
28*f4a2713aSLionel Sambuc	myObject.position = V3D;
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambuc// CHECK: call void @_ZN8Vector3DC1ERKS_
31*f4a2713aSLionel Sambuc	myObject.length = V3D;
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc        return 0;
34*f4a2713aSLionel Sambuc}
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc// rdar: // 8437253
37*f4a2713aSLionel Sambucextern "C" void exit(...);
38*f4a2713aSLionel Sambuc
39*f4a2713aSLionel Sambucstruct CGPoint {
40*f4a2713aSLionel Sambuc  float x;
41*f4a2713aSLionel Sambuc  float y;
42*f4a2713aSLionel Sambuc};
43*f4a2713aSLionel Sambuctypedef struct CGPoint CGPoint;
44*f4a2713aSLionel Sambuc
45*f4a2713aSLionel Sambucextern "C" const CGPoint CGPointZero;
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambucbool operator==(const CGPoint& a, const CGPoint& b);
48*f4a2713aSLionel Sambuc
49*f4a2713aSLionel Sambuc@interface TIconViewSettings
50*f4a2713aSLionel Sambuc@property (assign, nonatomic) CGPoint gridOffset;
51*f4a2713aSLionel Sambuc@end
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc@implementation TIconViewSettings
54*f4a2713aSLionel Sambuc- (CGPoint) gridOffset
55*f4a2713aSLionel Sambuc{
56*f4a2713aSLionel Sambuc return CGPointZero;
57*f4a2713aSLionel Sambuc}
58*f4a2713aSLionel Sambuc
59*f4a2713aSLionel Sambuc- (void) foo
60*f4a2713aSLionel Sambuc{
61*f4a2713aSLionel Sambuc        if ((self.gridOffset) == CGPointZero)
62*f4a2713aSLionel Sambuc                exit(1);
63*f4a2713aSLionel Sambuc
64*f4a2713aSLionel Sambuc if (self.gridOffset == CGPointZero)
65*f4a2713aSLionel Sambuc  exit(1);
66*f4a2713aSLionel Sambuc}
67*f4a2713aSLionel Sambuc@end
68*f4a2713aSLionel Sambuc
69