New testcase. DSE should delete all of the DEAD instructions.
authorChris Lattner <sabre@nondot.org>
Tue, 27 Jul 2004 02:19:27 +0000 (02:19 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Jul 2004 02:19:27 +0000 (02:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15253 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/DeadStoreElimination/context-sensitive.llx [new file with mode: 0644]

diff --git a/test/Transforms/DeadStoreElimination/context-sensitive.llx b/test/Transforms/DeadStoreElimination/context-sensitive.llx
new file mode 100644 (file)
index 0000000..428030c
--- /dev/null
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep DEAD
+
+declare void %ext() 
+
+int* %caller() {
+       %P = malloc int
+       %DEAD = load int* %P
+       %DEAD2 = add int %DEAD, 1
+       store int %DEAD2, int* %P  ;; dead store
+
+       call void %ext()         ; Can not clobber *P
+
+       store int 0, int* %P
+       ret int* %P
+}