summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjCXX/arc.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjCXX/arc.mm')
-rw-r--r--test/CodeGenObjCXX/arc.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/arc.mm b/test/CodeGenObjCXX/arc.mm
index 1888dbe..e3e86a0 100644
--- a/test/CodeGenObjCXX/arc.mm
+++ b/test/CodeGenObjCXX/arc.mm
@@ -275,3 +275,25 @@ id Test39::bar() { return 0; }
// CHECK: define i8* @_ZThn8_N6Test393barEv(
// CHECK: call i8* @_ZN6Test393barEv(
// CHECK-NEXT: ret i8*
+
+// rdar://13617051
+// Just a basic sanity-check that IR-gen still works after instantiating
+// a non-dependent message send that requires writeback.
+@interface Test40
++ (void) foo:(id *)errorPtr;
+@end
+template <class T> void test40_helper() {
+ id x;
+ [Test40 foo: &x];
+};
+template void test40_helper<int>();
+// CHECK: define weak_odr void @_Z13test40_helperIiEvv()
+// CHECK: [[X:%.*]] = alloca i8*
+// CHECK-NEXT: [[TEMP:%.*]] = alloca i8*
+// CHECK-NEXT: store i8* null, i8** [[X]]
+// CHECK: [[T0:%.*]] = load i8** [[X]]
+// CHECK-NEXT: store i8* [[T0]], i8** [[TEMP]]
+// CHECK: @objc_msgSend
+// CHECK-NEXT: [[T0:%.*]] = load i8** [[TEMP]]
+// CHECK-NEXT: call i8* @objc_retain(i8* [[T0]])
+
OpenPOWER on IntegriCloud