Fix IRGen issues related to using property-dot syntax
for prperty reference types. // rdar://9208606.

llvm-svn: 128551
diff --git a/clang/test/CodeGenObjCXX/property-reference.mm b/clang/test/CodeGenObjCXX/property-reference.mm
new file mode 100644
index 0000000..7c235cb
--- /dev/null
+++ b/clang/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:%.*]]