Fariborz Jahanian | 0ca0b1f | 2010-05-15 23:05:52 +0000 | [diff] [blame] | 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 |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 3 | // CHECK: call void @_ZN1SC1ERKS_ |
| 4 | // CHECK: call %class.S* @_ZN1SaSERKS_ |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 5 | // CHECK: call %class.S* @_ZN6CGRectaSERKS_ |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 6 | |
| 7 | class S { |
| 8 | public: |
| 9 | S& operator = (const S&); |
| 10 | S (const S&); |
| 11 | S (); |
| 12 | }; |
| 13 | |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 14 | struct CGRect { |
| 15 | CGRect & operator = (const CGRect &); |
| 16 | }; |
| 17 | |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 18 | @interface I { |
| 19 | S position; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 20 | CGRect bounds; |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 21 | } |
| 22 | @property(assign, nonatomic) S position; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 23 | @property CGRect bounds; |
Fariborz Jahanian | 0ca0b1f | 2010-05-15 23:05:52 +0000 | [diff] [blame] | 24 | @property CGRect frame; |
| 25 | - (void)setFrame:(CGRect)frameRect; |
| 26 | - (CGRect)frame; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 27 | - (void) initWithOwner; |
Fariborz Jahanian | 98c9d1f | 2010-09-01 19:36:41 +0000 | [diff] [blame] | 28 | - (struct CGRect)extent; |
| 29 | - (void)dealloc; |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 30 | @end |
| 31 | |
| 32 | @implementation I |
| 33 | @synthesize position; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 34 | @synthesize bounds; |
Fariborz Jahanian | 0ca0b1f | 2010-05-15 23:05:52 +0000 | [diff] [blame] | 35 | @synthesize frame; |
| 36 | - (void)setFrame:(CGRect)frameRect {} |
| 37 | - (CGRect)frame {return bounds;} |
| 38 | |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 39 | - (void)initWithOwner { |
Fariborz Jahanian | 0ca0b1f | 2010-05-15 23:05:52 +0000 | [diff] [blame] | 40 | I* _labelLayer; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 41 | CGRect labelLayerFrame = self.bounds; |
| 42 | labelLayerFrame = self.bounds; |
Fariborz Jahanian | 0ca0b1f | 2010-05-15 23:05:52 +0000 | [diff] [blame] | 43 | _labelLayer.frame = labelLayerFrame; |
Fariborz Jahanian | b3ebe94 | 2010-05-10 22:57:35 +0000 | [diff] [blame] | 44 | } |
Fariborz Jahanian | 98c9d1f | 2010-09-01 19:36:41 +0000 | [diff] [blame] | 45 | // rdar://8366604 |
| 46 | - (void)dealloc |
| 47 | { |
| 48 | CGRect cgrect = self.extent; |
| 49 | } |
| 50 | - (struct CGRect)extent {return bounds;} |
Fariborz Jahanian | 97a73cd | 2010-05-06 15:45:36 +0000 | [diff] [blame] | 51 | @end |
Fariborz Jahanian | bbb5224 | 2010-05-07 18:56:13 +0000 | [diff] [blame] | 52 | |
| 53 | int main() { |
| 54 | I *i; |
| 55 | S s1; |
| 56 | i.position = s1; |
| 57 | return 0; |
| 58 | } |
| 59 | |
Fariborz Jahanian | 4088ec0 | 2010-09-09 23:01:10 +0000 | [diff] [blame] | 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 | } |