2014-10-15 00:43:46 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -g -o - | FileCheck %s
|
2010-05-06 23:45:36 +08:00
|
|
|
|
|
|
|
class S {
|
|
|
|
public:
|
|
|
|
S& operator = (const S&);
|
|
|
|
S (const S&);
|
|
|
|
S ();
|
|
|
|
};
|
|
|
|
|
2010-05-11 06:57:35 +08:00
|
|
|
struct CGRect {
|
|
|
|
CGRect & operator = (const CGRect &);
|
|
|
|
};
|
|
|
|
|
2010-05-06 23:45:36 +08:00
|
|
|
@interface I {
|
|
|
|
S position;
|
2010-05-11 06:57:35 +08:00
|
|
|
CGRect bounds;
|
2010-05-06 23:45:36 +08:00
|
|
|
}
|
2012-11-14 07:16:33 +08:00
|
|
|
|
2010-05-06 23:45:36 +08:00
|
|
|
@property(assign, nonatomic) S position;
|
2010-05-11 06:57:35 +08:00
|
|
|
@property CGRect bounds;
|
2010-05-16 07:05:52 +08:00
|
|
|
@property CGRect frame;
|
|
|
|
- (void)setFrame:(CGRect)frameRect;
|
|
|
|
- (CGRect)frame;
|
2010-05-11 06:57:35 +08:00
|
|
|
- (void) initWithOwner;
|
2012-11-14 07:16:33 +08:00
|
|
|
- (CGRect)extent;
|
2010-09-02 03:36:41 +08:00
|
|
|
- (void)dealloc;
|
2010-05-06 23:45:36 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I
|
|
|
|
@synthesize position;
|
2010-05-11 06:57:35 +08:00
|
|
|
@synthesize bounds;
|
2010-05-16 07:05:52 +08:00
|
|
|
@synthesize frame;
|
2012-11-14 07:16:33 +08:00
|
|
|
|
|
|
|
// CHECK: define internal void @"\01-[I setPosition:]"
|
2014-07-18 23:52:10 +08:00
|
|
|
// CHECK: call dereferenceable({{[0-9]+}}) %class.S* @_ZN1SaSERKS_
|
2012-11-14 07:16:33 +08:00
|
|
|
// CHECK-NEXT: ret void
|
|
|
|
|
2014-10-15 00:43:46 +08:00
|
|
|
// Don't attach debug locations to the prologue instructions. These were
|
|
|
|
// leaking over from the previous function emission by accident.
|
|
|
|
// CHECK: define internal void @"\01-[I setBounds:]"
|
|
|
|
// CHECK-NOT: !dbg
|
|
|
|
// CHECK: call void @llvm.dbg.declare
|
2010-05-16 07:05:52 +08:00
|
|
|
- (void)setFrame:(CGRect)frameRect {}
|
|
|
|
- (CGRect)frame {return bounds;}
|
|
|
|
|
2010-05-11 06:57:35 +08:00
|
|
|
- (void)initWithOwner {
|
2010-05-16 07:05:52 +08:00
|
|
|
I* _labelLayer;
|
2010-05-11 06:57:35 +08:00
|
|
|
CGRect labelLayerFrame = self.bounds;
|
|
|
|
labelLayerFrame = self.bounds;
|
2010-05-16 07:05:52 +08:00
|
|
|
_labelLayer.frame = labelLayerFrame;
|
2010-05-11 06:57:35 +08:00
|
|
|
}
|
2012-11-14 07:16:33 +08:00
|
|
|
|
2010-09-02 03:36:41 +08:00
|
|
|
// rdar://8366604
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
|
|
|
CGRect cgrect = self.extent;
|
|
|
|
}
|
|
|
|
- (struct CGRect)extent {return bounds;}
|
2012-11-14 07:16:33 +08:00
|
|
|
|
2010-05-06 23:45:36 +08:00
|
|
|
@end
|
2010-05-08 02:56:13 +08:00
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define i32 @main
|
2014-07-18 23:52:10 +08:00
|
|
|
// CHECK: call void @_ZN1SC1ERKS_(%class.S* [[AGGTMP:%[a-zA-Z0-9\.]+]], %class.S* dereferenceable({{[0-9]+}}) {{%[a-zA-Z0-9\.]+}})
|
2012-11-14 07:16:33 +08:00
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %class.S*)*)(i8* {{%[a-zA-Z0-9\.]+}}, i8* {{%[a-zA-Z0-9\.]+}}, %class.S* [[AGGTMP]])
|
|
|
|
// CHECK-NEXT: ret i32 0
|
2010-05-08 02:56:13 +08:00
|
|
|
int main() {
|
|
|
|
I *i;
|
|
|
|
S s1;
|
|
|
|
i.position = s1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-09-10 07:01:10 +08:00
|
|
|
// rdar://8379892
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fP1A
|
2012-11-14 07:16:33 +08:00
|
|
|
// CHECK: call void @_ZN1XC1Ev(%struct.X* [[LVTEMP:%[a-zA-Z0-9\.]+]])
|
2014-07-18 23:52:10 +08:00
|
|
|
// CHECK: call void @_ZN1XC1ERKS_(%struct.X* [[AGGTMP:%[a-zA-Z0-9\.]+]], %struct.X* dereferenceable({{[0-9]+}}) [[LVTEMP]])
|
2012-11-14 07:16:33 +08:00
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.X*)*)({{.*}} %struct.X* [[AGGTMP]])
|
2010-09-10 07:01:10 +08:00
|
|
|
struct X {
|
|
|
|
X();
|
|
|
|
X(const X&);
|
|
|
|
~X();
|
|
|
|
};
|
|
|
|
|
|
|
|
@interface A {
|
|
|
|
X xval;
|
|
|
|
}
|
|
|
|
- (X)x;
|
|
|
|
- (void)setX:(X)x;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void f(A* a) {
|
|
|
|
a.x = X();
|
|
|
|
}
|