summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-09 07:05:44 +0000
committerChris Lattner <sabre@nondot.org>2011-04-09 07:05:44 +0000
commit0403b473dd99b5c7db1fa7048288be6cb42e7abd (patch)
tree59a2903ef8c22712780d39dcdbfba04e4b27a4a5 /test/CodeGen/Generic
parentc3e4e59d1017178fdff33d6e34635f498c98592f (diff)
downloadllvm-0403b473dd99b5c7db1fa7048288be6cb42e7abd.tar.gz
llvm-0403b473dd99b5c7db1fa7048288be6cb42e7abd.tar.bz2
llvm-0403b473dd99b5c7db1fa7048288be6cb42e7abd.tar.xz
Fix a bug where RecursivelyDeleteTriviallyDeadInstructions could
delete the instruction pointed to by CGP's current instruction iterator, leading to a crash on the testcase. This fixes PR9578. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic')
-rw-r--r--test/CodeGen/Generic/crash.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/crash.ll b/test/CodeGen/Generic/crash.ll
index 042739884d..e7cc7e3394 100644
--- a/test/CodeGen/Generic/crash.ll
+++ b/test/CodeGen/Generic/crash.ll
@@ -38,3 +38,31 @@ unreachable
declare void @Parse_Vector(double*)
declare i32 @llvm.objectsize.i32(i8*, i1)
+
+; PR9578
+%struct.S0 = type { i32, i8, i32 }
+
+define void @func_82() nounwind optsize {
+entry:
+ br label %for.body.i
+
+for.body.i: ; preds = %for.body.i, %entry
+ br i1 undef, label %func_74.exit.for.cond29.thread_crit_edge, label %for.body.i
+
+func_74.exit.for.cond29.thread_crit_edge: ; preds = %for.body.i
+ %f13576.pre = getelementptr inbounds %struct.S0* undef, i64 0, i32 1
+ store i8 0, i8* %f13576.pre, align 4, !tbaa !0
+ br label %lbl_468
+
+lbl_468: ; preds = %lbl_468, %func_74.exit.for.cond29.thread_crit_edge
+ %f13577.ph = phi i8* [ %f13576.pre, %func_74.exit.for.cond29.thread_crit_edge ], [ %f135.pre, %lbl_468 ]
+ store i8 1, i8* %f13577.ph, align 1
+ %f135.pre = getelementptr inbounds %struct.S0* undef, i64 0, i32 1
+ br i1 undef, label %lbl_468, label %for.end74
+
+for.end74: ; preds = %lbl_468
+ ret void
+}
+
+!0 = metadata !{metadata !"omnipotent char", metadata !1}
+!1 = metadata !{metadata !"Simple C/C++ TBAA", null}