Debian Codegraph @

clang/test/CodeGenObjCXX/property-object-conditional-exp.mm

raw
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %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 // CHECK: [[SRC:%.*]] = call { ptr, i32 } @objc_msgSend
26 // CHECK-NEXT:getelementptr inbounds nuw { ptr, i32 }, ptr [[SRC:%.*]]
27 // CHECK-NEXT:extractvalue
28 // CHECK-NEXT:store
29 // CHECK-NEXT:getelementptr inbounds nuw { ptr, i32 }, ptr [[SRC:%.*]]
30 // CHECK-NEXT:extractvalue
31 // CHECK-NEXT:store
32 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