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