aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2012-07-23 19:27:31 +0000
committerDan Gohman <gohman@apple.com>2012-07-23 19:27:31 +0000
commitc72d3be38915728142d13f982eeef218e42f21aa (patch)
treec37b23790d66dd87d0b2174386354f0ff40ff366 /test/Transforms
parentec5e97f5c874a82aa995cffee8c5592c6689ffb4 (diff)
downloadexternal_llvm-c72d3be38915728142d13f982eeef218e42f21aa.zip
external_llvm-c72d3be38915728142d13f982eeef218e42f21aa.tar.gz
external_llvm-c72d3be38915728142d13f982eeef218e42f21aa.tar.bz2
An objc_retain can serve as a may-use for a different pointer.
rdar://11931823. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160637 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/ObjCARC/basic.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/ObjCARC/basic.ll b/test/Transforms/ObjCARC/basic.ll
index ba2f778..d9bb3f2 100644
--- a/test/Transforms/ObjCARC/basic.ll
+++ b/test/Transforms/ObjCARC/basic.ll
@@ -1871,6 +1871,30 @@ return: ; preds = %if.then, %entry
ret i8* %retval
}
+; An objc_retain can serve as a may-use for a different pointer.
+; rdar://11931823
+
+; CHECK: define void @test66(
+; CHECK: %tmp7 = tail call i8* @objc_retain(i8* %cond) nounwind
+; CHECK: tail call void @objc_release(i8* %cond) nounwind
+; CHECK: }
+define void @test66(i8* %tmp5, i8* %bar, i1 %tobool, i1 %tobool1, i8* %call) {
+entry:
+ br i1 %tobool, label %cond.true, label %cond.end
+
+cond.true:
+ br label %cond.end
+
+cond.end: ; preds = %cond.true, %entry
+ %cond = phi i8* [ %tmp5, %cond.true ], [ %call, %entry ]
+ %tmp7 = tail call i8* @objc_retain(i8* %cond) nounwind
+ tail call void @objc_release(i8* %call) nounwind
+ %tmp8 = select i1 %tobool1, i8* %cond, i8* %bar
+ %tmp9 = tail call i8* @objc_retain(i8* %tmp8) nounwind
+ tail call void @objc_release(i8* %cond) nounwind
+ ret void
+}
+
declare void @bar(i32 ()*)
; A few real-world testcases.