Fariborz Jahanian | 3911a1a | 2010-09-25 01:08:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s |
| 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 | |
| 25 | dataRect = CGRectIsEmpty(virtualBounds) ? self.bounds : virtualBounds; |
| 26 | dataRect = CGRectIsEmpty(virtualBounds) ? [self bounds] : virtualBounds; |
| 27 | dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.bounds; |
| 28 | |
| 29 | dataRect = CGRectIsEmpty(virtualBounds) ? self.out : virtualBounds; |
| 30 | dataRect = CGRectIsEmpty(virtualBounds) ? [self out] : virtualBounds; |
| 31 | dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.out; |
| 32 | } |
| 33 | |
| 34 | @dynamic bounds; |
| 35 | - (CGRect) out { return out; } |
| 36 | @end |