summaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/property-reference.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjCXX/property-reference.mm')
-rw-r--r--test/CodeGenObjCXX/property-reference.mm34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/property-reference.mm b/test/CodeGenObjCXX/property-reference.mm
new file mode 100644
index 0000000000000..7c235cb9b4ef7
--- /dev/null
+++ b/test/CodeGenObjCXX/property-reference.mm
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// rdar://9208606
+
+struct MyStruct
+{
+ int x;
+ int y;
+ int z;
+};
+
+@interface MyClass
+{
+ MyStruct _foo;
+}
+
+@property (assign, readwrite) const MyStruct& foo;
+
+- (const MyStruct&) foo;
+- (void) setFoo:(const MyStruct&)inFoo;
+@end
+
+int main()
+{
+ MyClass* myClass;
+ MyStruct myStruct;
+
+ myClass.foo = myStruct;
+
+ const MyStruct& currentMyStruct = myClass.foo;
+ return 0;
+}
+
+// CHECK: [[C:%.*]] = call %struct.MyStruct* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
+// CHECK: store %struct.MyStruct* [[C]], %struct.MyStruct** [[D:%.*]]