blob: a3c1027ed709d04a97a4bb7de0533021ceab6bcf [file] [log] [blame]
Fariborz Jahanian30e8d582010-09-27 17:30:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
Fariborz Jahanianc60da032010-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 Jahanian557c1ed2011-02-28 21:19:34 +000025// CHECK: [[SRC:%.*]] = call %struct.CGRect bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
Eli Friedmanaf9b3252011-05-17 21:08:01 +000026// CHECK-NEXT:getelementptr %struct.CGRect* [[SRC:%.*]]
27// CHECK-NEXT:extractvalue
28// CHECK-NEXT:store
29// CHECK-NEXT:getelementptr %struct.CGRect* [[SRC:%.*]]
30// CHECK-NEXT:extractvalue
31// CHECK-NEXT:store
Fariborz Jahanianc60da032010-09-25 01:08:05 +000032 dataRect = CGRectIsEmpty(virtualBounds) ? self.bounds : virtualBounds;
33 dataRect = CGRectIsEmpty(virtualBounds) ? [self bounds] : virtualBounds;
34 dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.bounds;
35
36 dataRect = CGRectIsEmpty(virtualBounds) ? self.out : virtualBounds;
37 dataRect = CGRectIsEmpty(virtualBounds) ? [self out] : virtualBounds;
38 dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.out;
39}
40
41@dynamic bounds;
42- (CGRect) out { return out; }
43@end