Debian Codegraph @

clang/test/CodeGenObjCXX/property-object-reference.mm

raw
1 // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - | FileCheck %s
2
3 struct Foo {int i;};
4 static Foo gFoo;
5
6
7 @interface ObjCTest { }
8 @property (nonatomic, readonly) Foo& FooRefProperty;
9 @property (nonatomic) Foo FooProperty;
10 - (Foo &) FooProperty;
11 - (void)setFooProperty : (Foo &) arg;
12 @end
13
14
15 @implementation ObjCTest
16 @dynamic FooRefProperty;
17
18 -(void) test {
19 Foo& f = self.FooRefProperty;
20 Foo& f1 = self.FooProperty;
21 }
22 - (Foo &) FooProperty { return gFoo; }
23 - (void)setFooProperty : (Foo &) arg { };
24 @end
25
26 // CHECK: [[T0:%.*]] = load {{.*}} [[S0:%.*]]
27 // CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_
28 // CHECK: @objc_msgSend
29 // CHECK: [[R0:%.*]] = load {{.*}} [[U0:%.*]]
30 // CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_
31 // CHECK: @objc_msgSend
32