In the latest episode of "Deserializing bugs caused by accessors" the series reached...
[clang.git] / test / CodeGenObjCXX / property-dot-copy.mm
blob9b23c58ca17b41ca7eac4ba888f95a9e43314dbf
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -o - %s | FileCheck %s
2 // rdar://8427922
4 struct Vector3D
6                 float x, y, z;
7                 Vector3D();
8                 Vector3D(const Vector3D &inVector);
9                 Vector3D(float initX, float initY, float initZ);
10                 Vector3D &operator=(const Vector3D & rhs);
13 @interface Object3D
15         Vector3D position;
16         Vector3D length;
18 @property (assign) Vector3D position;
19 - (Vector3D) length;
20 - (void) setLength: (Vector3D)arg;
21 @end
23 int main () 
25         Object3D *myObject;
26         Vector3D V3D(1.0f, 1.0f, 1.0f);
27 // CHECK: call void @_ZN8Vector3DC1ERKS_
28         myObject.position = V3D;
30 // CHECK: call void @_ZN8Vector3DC1ERKS_
31         myObject.length = V3D;
33         return 0;
36 // rdar: // 8437253
37 extern "C" void exit(...);
39 struct CGPoint {
40   float x;
41   float y;
43 typedef struct CGPoint CGPoint;
45 extern "C" const CGPoint CGPointZero;
47 bool operator==(const CGPoint& a, const CGPoint& b);
49 @interface TIconViewSettings
50 @property (assign, nonatomic) CGPoint gridOffset;
51 @end
53 @implementation TIconViewSettings
54 - (CGPoint) gridOffset
56  return CGPointZero;
59 - (void) foo
61         if ((self.gridOffset) == CGPointZero)
62                 exit(1);
64  if (self.gridOffset == CGPointZero)
65   exit(1);
67 @end