John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s |
Fariborz Jahanian | 3911a1a | 2010-09-25 01:08:05 +0000 | [diff] [blame] | 2 | |
| 3 | struct CGRect { |
| 4 | char* origin; |
| 5 | unsigned size; |
| 6 | }; |
| 7 | typedef struct CGRect CGRect; |
| 8 | |
| 9 | extern "C" bool CGRectIsEmpty(CGRect); |
| 10 | |
| 11 | @interface Foo { |
| 12 | CGRect out; |
| 13 | } |
| 14 | @property CGRect bounds; |
| 15 | - (CGRect) out; |
| 16 | @end |
| 17 | |
| 18 | |
| 19 | @implementation Foo |
| 20 | |
| 21 | - (void)bar { |
| 22 | CGRect dataRect; |
| 23 | CGRect virtualBounds; |
| 24 | |
Chris Lattner | 9cbe4f0 | 2011-07-09 17:41:47 +0000 | [diff] [blame] | 25 | // CHECK: [[SRC:%.*]] = call { i8*, i32 } bitcast (i8* (i8*, i8*, ...)* @objc_msgSend |
| 26 | // CHECK-NEXT: bitcast |
| 27 | // CHECK-NEXT:getelementptr { i8*, i32 }* [[SRC:%.*]] |
Eli Friedman | badea57 | 2011-05-17 21:08:01 +0000 | [diff] [blame] | 28 | // CHECK-NEXT:extractvalue |
| 29 | // CHECK-NEXT:store |
Chris Lattner | 9cbe4f0 | 2011-07-09 17:41:47 +0000 | [diff] [blame] | 30 | // CHECK-NEXT:getelementptr { i8*, i32 }* [[SRC:%.*]] |
Eli Friedman | badea57 | 2011-05-17 21:08:01 +0000 | [diff] [blame] | 31 | // CHECK-NEXT:extractvalue |
| 32 | // CHECK-NEXT:store |
Fariborz Jahanian | 3911a1a | 2010-09-25 01:08:05 +0000 | [diff] [blame] | 33 | dataRect = CGRectIsEmpty(virtualBounds) ? self.bounds : virtualBounds; |
| 34 | dataRect = CGRectIsEmpty(virtualBounds) ? [self bounds] : virtualBounds; |
| 35 | dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.bounds; |
| 36 | |
| 37 | dataRect = CGRectIsEmpty(virtualBounds) ? self.out : virtualBounds; |
| 38 | dataRect = CGRectIsEmpty(virtualBounds) ? [self out] : virtualBounds; |
| 39 | dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.out; |
| 40 | } |
| 41 | |
| 42 | @dynamic bounds; |
| 43 | - (CGRect) out { return out; } |
| 44 | @end |