blob: 826c351e79efa90e59d508227ee3ec7e8a2448f8 [file] [log] [blame]
Fariborz Jahaniandb148be2010-09-27 17:30:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
Fariborz Jahanian3911a1a2010-09-25 01:08:05 +00002
3struct CGRect {
4 char* origin;
5 unsigned size;
6};
7typedef struct CGRect CGRect;
8
9extern "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
Fariborz Jahaniandb148be2010-09-27 17:30:38 +000025// CHECK: [[SRC:%.*]] = call %struct.CGRect bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
26// CHECK-NEXT:store %struct.CGRect [[SRC]], %struct.CGRect*
Fariborz Jahanian3911a1a2010-09-25 01:08:05 +000027 dataRect = CGRectIsEmpty(virtualBounds) ? self.bounds : virtualBounds;
28 dataRect = CGRectIsEmpty(virtualBounds) ? [self bounds] : virtualBounds;
29 dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.bounds;
30
31 dataRect = CGRectIsEmpty(virtualBounds) ? self.out : virtualBounds;
32 dataRect = CGRectIsEmpty(virtualBounds) ? [self out] : virtualBounds;
33 dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.out;
34}
35
36@dynamic bounds;
37- (CGRect) out { return out; }
38@end