summaryrefslogtreecommitdiff
path: root/test/Transforms/ObjCARC/contract-storestrong.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2012-05-09 23:08:33 +0000
committerDan Gohman <gohman@apple.com>2012-05-09 23:08:33 +0000
commit95b8cf1f11fa2582d05f87a83a580e92afd5500d (patch)
tree1417fbd27d85f8937d80ba0faceca702ca09a31f /test/Transforms/ObjCARC/contract-storestrong.ll
parentca313e1efa98910a7a5e7f4bf2ac1a70adb6e4fe (diff)
downloadllvm-95b8cf1f11fa2582d05f87a83a580e92afd5500d.tar.gz
llvm-95b8cf1f11fa2582d05f87a83a580e92afd5500d.tar.bz2
llvm-95b8cf1f11fa2582d05f87a83a580e92afd5500d.tar.xz
Fix the objc_storeStrong recognizer to stop before walking off the
end of a basic block if there's no store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ObjCARC/contract-storestrong.ll')
-rw-r--r--test/Transforms/ObjCARC/contract-storestrong.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Transforms/ObjCARC/contract-storestrong.ll b/test/Transforms/ObjCARC/contract-storestrong.ll
index de84b41b8e..2922f816d5 100644
--- a/test/Transforms/ObjCARC/contract-storestrong.ll
+++ b/test/Transforms/ObjCARC/contract-storestrong.ll
@@ -132,4 +132,38 @@ entry:
ret i1 %t
}
+; Like test0, but there's no store, so don't form an objc_storeStrong.
+
+; CHECK: define void @test7(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) nounwind
+; CHECK-NEXT: %tmp = load i8** @x, align 8
+; CHECK-NEXT: tail call void @objc_release(i8* %tmp) nounwind
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
+define void @test7(i8* %p) {
+entry:
+ %0 = tail call i8* @objc_retain(i8* %p) nounwind
+ %tmp = load i8** @x, align 8
+ tail call void @objc_release(i8* %tmp) nounwind
+ ret void
+}
+
+; Like test0, but there's no retain, so don't form an objc_storeStrong.
+
+; CHECK: define void @test8(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %tmp = load i8** @x, align 8
+; CHECK-NEXT: store i8* %p, i8** @x, align 8
+; CHECK-NEXT: tail call void @objc_release(i8* %tmp) nounwind
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
+define void @test8(i8* %p) {
+entry:
+ %tmp = load i8** @x, align 8
+ store i8* %p, i8** @x, align 8
+ tail call void @objc_release(i8* %tmp) nounwind
+ ret void
+}
+
!0 = metadata !{}