aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-08 02:17:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-08 02:17:32 +0000
commit1b88fc012240d10af5a80571aa8def36796f7b18 (patch)
tree1f980602b6d7c657fa53c58d11443f162a63d894 /test
parent913ff09a9acf563ae9719ff223bc117dd66ad6b0 (diff)
downloadexternal_llvm-1b88fc012240d10af5a80571aa8def36796f7b18.zip
external_llvm-1b88fc012240d10af5a80571aa8def36796f7b18.tar.gz
external_llvm-1b88fc012240d10af5a80571aa8def36796f7b18.tar.bz2
isAllocLikeFn is allowed to return true for functions which read memory; make
sure we account for that correctly in DeadStoreElimination. Fixes a regression from r158919. PR13547. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/DeadStoreElimination/simple.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll
index a386206..ed53ab7 100644
--- a/test/Transforms/DeadStoreElimination/simple.ll
+++ b/test/Transforms/DeadStoreElimination/simple.ll
@@ -276,3 +276,18 @@ define void @test22(i1 %i, i32 %k, i32 %m) nounwind {
; CHECK-NEXT: ret void
ret void
}
+
+; PR13547
+; CHECK: @test23
+; CHECK: store i8 97
+; CHECK: store i8 0
+declare noalias i8* @strdup(i8* nocapture) nounwind
+define noalias i8* @test23() nounwind uwtable ssp {
+ %x = alloca [2 x i8], align 1
+ %arrayidx = getelementptr inbounds [2 x i8]* %x, i64 0, i64 0
+ store i8 97, i8* %arrayidx, align 1
+ %arrayidx1 = getelementptr inbounds [2 x i8]* %x, i64 0, i64 1
+ store i8 0, i8* %arrayidx1, align 1
+ %call = call i8* @strdup(i8* %arrayidx) nounwind
+ ret i8* %call
+}