summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-14 00:19:00 +0000
committerChris Lattner <sabre@nondot.org>2010-09-14 00:19:00 +0000
commit7abdb22e52e2122cb04479a1129dc68916dece4c (patch)
treeca1e440a64d678b09c1a63a370ad9968d66d49fb /test
parent3a210e2d302758101ac06946e86027b327c7d0f3 (diff)
downloadllvm-7abdb22e52e2122cb04479a1129dc68916dece4c.tar.gz
llvm-7abdb22e52e2122cb04479a1129dc68916dece4c.tar.bz2
llvm-7abdb22e52e2122cb04479a1129dc68916dece4c.tar.xz
fix PR8102, a case where we'd copyValue from a value that we already
deleted. Fix this by doing the copyValue's before we delete stuff! The testcase only repros the problem on my system with valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/LICM/crash.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/LICM/crash.ll b/test/Transforms/LICM/crash.ll
index d0b6d78db1..88be5c41cc 100644
--- a/test/Transforms/LICM/crash.ll
+++ b/test/Transforms/LICM/crash.ll
@@ -39,3 +39,23 @@ for.body: ; preds = %for.body, %entry
store i32 undef, i32* @g_8, align 4
br label %for.body
}
+
+; PR8102
+define void @test3() {
+entry:
+ %__first = alloca { i32* }
+ br i1 undef, label %for.cond, label %for.end
+
+for.cond: ; preds = %for.cond, %entry
+ %tmp1 = getelementptr { i32*}* %__first, i32 0, i32 0
+ %tmp2 = load i32** %tmp1, align 4
+ %call = tail call i32* @test3helper(i32* %tmp2)
+ %tmp3 = getelementptr { i32*}* %__first, i32 0, i32 0
+ store i32* %call, i32** %tmp3, align 4
+ br i1 false, label %for.cond, label %for.end
+
+for.end: ; preds = %for.cond, %entry
+ ret void
+}
+
+declare i32* @test3helper(i32*)