diff options
author | John McCall <rjmccall@apple.com> | 2013-03-23 02:35:54 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-03-23 02:35:54 +0000 |
commit | b6a6079449a5275c283982e19b0c38e165833bb2 (patch) | |
tree | c5448c62a1faeaada372f8d7a08dfdf85293a7fc /test/CodeGenObjCXX | |
parent | 060fe33d41ea975db519c96def5c2d2b1da7a78f (diff) | |
download | clang-b6a6079449a5275c283982e19b0c38e165833bb2.tar.gz clang-b6a6079449a5275c283982e19b0c38e165833bb2.tar.bz2 clang-b6a6079449a5275c283982e19b0c38e165833bb2.tar.xz |
Under ARC, when we're passing the address of a strong variable
to an out-parameter using the indirect-writeback conversion,
and we copied the current value of the variable to the temporary,
make sure that we register an intrinsic use of that value with
the optimizer so that the value won't get released until we have
a chance to retain it.
rdar://13195034
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjCXX')
-rw-r--r-- | test/CodeGenObjCXX/arc.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/arc.mm b/test/CodeGenObjCXX/arc.mm index aa40f930ca..1888dbe77d 100644 --- a/test/CodeGenObjCXX/arc.mm +++ b/test/CodeGenObjCXX/arc.mm @@ -76,11 +76,13 @@ void test34(int cond) { // CHECK: [[T0:%.*]] = load i8** [[ARG]] // CHECK-NEXT: store i8* [[T0]], i8** [[TEMP1]] // CHECK-NEXT: br label + // CHECK: [[W0:%.*]] = phi i8* [ [[T0]], {{%.*}} ], [ undef, {{%.*}} ] // CHECK: call void @_Z11test34_sinkPU15__autoreleasingP11objc_object(i8** [[T1]]) // CHECK-NEXT: [[T0:%.*]] = icmp eq i8** [[ARG]], null // CHECK-NEXT: br i1 [[T0]], // CHECK: [[T0:%.*]] = load i8** [[TEMP1]] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) + // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[W0]]) // CHECK-NEXT: [[T2:%.*]] = load i8** [[ARG]] // CHECK-NEXT: store i8* [[T1]], i8** [[ARG]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) |