Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenObjCXX / property-dot-copy.mm
blobdad8575a831f3a6dd09efb4c056fc13d8a334446
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
3 struct Vector3D
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);
12 @interface Object3D
14         Vector3D position;
15         Vector3D length;
17 @property (assign) Vector3D position;
18 - (Vector3D) length;
19 - (void) setLength: (Vector3D)arg;
20 @end
22 int main () 
24         Object3D *myObject;
25         Vector3D V3D(1.0f, 1.0f, 1.0f);
26 // CHECK: call void @_ZN8Vector3DC1ERKS_
27         myObject.position = V3D;
29 // CHECK: call void @_ZN8Vector3DC1ERKS_
30         myObject.length = V3D;
32         return 0;
35 extern "C" void exit(...);
37 struct CGPoint {
38   float x;
39   float y;
41 typedef struct CGPoint CGPoint;
43 extern "C" const CGPoint CGPointZero;
45 bool operator==(const CGPoint& a, const CGPoint& b);
47 @interface TIconViewSettings
48 @property (assign, nonatomic) CGPoint gridOffset;
49 @end
51 @implementation TIconViewSettings
52 - (CGPoint) gridOffset
54  return CGPointZero;
57 - (void) foo
59         if ((self.gridOffset) == CGPointZero)
60                 exit(1);
62  if (self.gridOffset == CGPointZero)
63   exit(1);
65 @end