blob: 8e98b0dae7e4762789d6df4cfcb1f14541e27b8d [file] [log] [blame]
Fariborz Jahanian0ca0b1f2010-05-15 23:05:52 +00001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fobjc-nonfragile-abi -emit-llvm -o - | FileCheck %s
2// CHECK-NOT: callq _objc_msgSend_stret
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +00003// CHECK: call void @_ZN1SC1ERKS_
4// CHECK: call %class.S* @_ZN1SaSERKS_
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +00005// CHECK: call %class.S* @_ZN6CGRectaSERKS_
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +00006
7class S {
8public:
9 S& operator = (const S&);
10 S (const S&);
11 S ();
12};
13
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000014struct CGRect {
15 CGRect & operator = (const CGRect &);
16};
17
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +000018@interface I {
19 S position;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000020 CGRect bounds;
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +000021}
22@property(assign, nonatomic) S position;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000023@property CGRect bounds;
Fariborz Jahanian0ca0b1f2010-05-15 23:05:52 +000024@property CGRect frame;
25- (void)setFrame:(CGRect)frameRect;
26- (CGRect)frame;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000027- (void) initWithOwner;
Fariborz Jahanian98c9d1f2010-09-01 19:36:41 +000028- (struct CGRect)extent;
29- (void)dealloc;
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +000030@end
31
32@implementation I
33@synthesize position;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000034@synthesize bounds;
Fariborz Jahanian0ca0b1f2010-05-15 23:05:52 +000035@synthesize frame;
36- (void)setFrame:(CGRect)frameRect {}
37- (CGRect)frame {return bounds;}
38
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000039- (void)initWithOwner {
Fariborz Jahanian0ca0b1f2010-05-15 23:05:52 +000040 I* _labelLayer;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000041 CGRect labelLayerFrame = self.bounds;
42 labelLayerFrame = self.bounds;
Fariborz Jahanian0ca0b1f2010-05-15 23:05:52 +000043 _labelLayer.frame = labelLayerFrame;
Fariborz Jahanianb3ebe942010-05-10 22:57:35 +000044}
Fariborz Jahanian98c9d1f2010-09-01 19:36:41 +000045// rdar://8366604
46- (void)dealloc
47 {
48 CGRect cgrect = self.extent;
49 }
50- (struct CGRect)extent {return bounds;}
Fariborz Jahanian97a73cd2010-05-06 15:45:36 +000051@end
Fariborz Jahanianbbb52242010-05-07 18:56:13 +000052
53int main() {
54 I *i;
55 S s1;
56 i.position = s1;
57 return 0;
58}
59
Fariborz Jahanian4088ec02010-09-09 23:01:10 +000060// rdar://8379892
61// CHECK: define void @_Z1fP1A
62// CHECK: @objc_msgSend to void
63struct 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
76void f(A* a) {
77 a.x = X();
78}