aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/DeadStoreElimination/context-sensitive.llx15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/DeadStoreElimination/context-sensitive.llx b/test/Transforms/DeadStoreElimination/context-sensitive.llx
new file mode 100644
index 0000000..428030c
--- /dev/null
+++ b/test/Transforms/DeadStoreElimination/context-sensitive.llx
@@ -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
+}