Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - | FileCheck %s
      2 // CHECK-NOT: callq	_objc_msgSend_stret
      3 // CHECK: call void @_ZN1SC1ERKS_
      4 // CHECK: call %class.S* @_ZN1SaSERKS_
      5 // CHECK: call %struct.CGRect* @_ZN6CGRectaSERKS_
      6 
      7 class S {
      8 public:
      9 	S& operator = (const S&);
     10 	S (const S&);
     11 	S ();
     12 };
     13 
     14 struct CGRect {
     15 	CGRect & operator = (const CGRect &);
     16 };
     17 
     18 @interface I {
     19   S position;
     20   CGRect bounds;
     21 }
     22 @property(assign, nonatomic) S position;
     23 @property CGRect bounds;
     24 @property CGRect frame;
     25 - (void)setFrame:(CGRect)frameRect;
     26 - (CGRect)frame;
     27 - (void) initWithOwner;
     28 - (struct CGRect)extent;
     29 - (void)dealloc;
     30 @end
     31 
     32 @implementation I
     33 @synthesize position;
     34 @synthesize bounds;
     35 @synthesize frame;
     36 - (void)setFrame:(CGRect)frameRect {}
     37 - (CGRect)frame {return bounds;}
     38 
     39 - (void)initWithOwner {
     40   I* _labelLayer;
     41   CGRect labelLayerFrame = self.bounds;
     42   labelLayerFrame = self.bounds;
     43   _labelLayer.frame = labelLayerFrame;
     44 }
     45 // rdar://8366604
     46 - (void)dealloc
     47   {
     48       CGRect cgrect = self.extent;
     49   }
     50 - (struct CGRect)extent {return bounds;}
     51 @end
     52 
     53 int main() {
     54   I *i;
     55   S s1;
     56   i.position = s1;
     57   return 0;
     58 }
     59 
     60 // rdar://8379892
     61 // CHECK: define void @_Z1fP1A
     62 // CHECK: @objc_msgSend to void
     63 struct X {
     64   X();
     65   X(const X&);
     66   ~X();
     67 };
     68 
     69 @interface A {
     70   X xval;
     71 }
     72 - (X)x;
     73 - (void)setX:(X)x;
     74 @end
     75 
     76 void f(A* a) {
     77   a.x = X();
     78 }
     79