summaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/references.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjCXX/references.mm')
-rw-r--r--test/CodeGenObjCXX/references.mm25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/references.mm b/test/CodeGenObjCXX/references.mm
new file mode 100644
index 000000000000..c2232e2e02f8
--- /dev/null
+++ b/test/CodeGenObjCXX/references.mm
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+
+struct A { ~A(); };
+
+@interface B {
+ A a;
+}
+
+- (const A&)getA;
+@end
+
+@implementation B
+
+- (const A&)getA {
+ return a;
+}
+
+@end
+
+// CHECK: define void @_Z1fP1B
+// CHECK: objc_msgSend to
+// CHECK: ret void
+void f(B* b) {
+ (void)[b getA];
+}