summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/arc.m
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-14 19:53:16 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-14 19:53:16 +0000
commit16de4d20e04d82761a5f52e961989335d56ace50 (patch)
treeef9fca35544418456b12169ebf37548dd306c3d4 /clang/test/CodeGenObjC/arc.m
parent319904cc7e947083efd9213e42b9c39bc35ceeae (diff)
downloadbcm5719-llvm-16de4d20e04d82761a5f52e961989335d56ace50.tar.gz
bcm5719-llvm-16de4d20e04d82761a5f52e961989335d56ace50.zip
In ARC, don't reclaim objects of Class type.
llvm-svn: 144561
Diffstat (limited to 'clang/test/CodeGenObjC/arc.m')
-rw-r--r--clang/test/CodeGenObjC/arc.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m
index 47da27c3855..492c1b89da1 100644
--- a/clang/test/CodeGenObjC/arc.m
+++ b/clang/test/CodeGenObjC/arc.m
@@ -1508,3 +1508,27 @@ void test66(void) {
// CHECK-NEXT: [[T8:%.*]] = bitcast [[TEST66]]* [[T3]] to i8*
// CHECK-NEXT: call void @objc_release(i8* [[T8]])
// CHECK-NEXT: ret void
+
+// rdar://problem/9953540
+Class test67_helper(void);
+void test67(void) {
+ Class cl = test67_helper();
+}
+// CHECK: define void @test67()
+// CHECK: [[CL:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper()
+// CHECK-NEXT: store i8* [[T0]], i8** [[CL]], align 8
+// CHECK-NEXT: ret void
+
+Class test68_helper(void);
+void test68(void) {
+ __strong Class cl = test67_helper();
+}
+// CHECK: define void @test68()
+// CHECK: [[CL:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper()
+// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
+// CHECK-NEXT: store i8* [[T1]], i8** [[CL]], align 8
+// CHECK-NEXT: [[T2:%.*]] = load i8** [[CL]]
+// CHECK-NEXT: call void @objc_release(i8* [[T2]])
+// CHECK-NEXT: ret void
OpenPOWER on IntegriCloud