summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-03-12 06:17:22 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-03-12 06:17:22 +0000
commita24653cdfc1e4ec7a8055d8f086e2a210cfd7bac (patch)
tree150fe87add5925eea49deb6524ee861eb50be198
parent4230f40add2157100e2c0b94f98b04670a02d621 (diff)
downloadllvm-a24653cdfc1e4ec7a8055d8f086e2a210cfd7bac.tar.gz
llvm-a24653cdfc1e4ec7a8055d8f086e2a210cfd7bac.tar.bz2
llvm-a24653cdfc1e4ec7a8055d8f086e2a210cfd7bac.tar.xz
Test the mod/ref analysis in DSA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12333 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/DSGraph/2004-03-10-ElimLoad.ll13
-rw-r--r--test/Analysis/DSGraph/2004-03-10-NoElimLoad.ll14
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Analysis/DSGraph/2004-03-10-ElimLoad.ll b/test/Analysis/DSGraph/2004-03-10-ElimLoad.ll
new file mode 100644
index 0000000000..1ae0a48a84
--- /dev/null
+++ b/test/Analysis/DSGraph/2004-03-10-ElimLoad.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | opt -ds-aa -load-vn -gcse -instcombine | llvm-dis | not grep sub
+
+void %bar(int* %p) {
+ ret void
+}
+
+int %foo(int* %a) {
+ %b = load int* %a
+ call void %bar(int* %a)
+ %d = load int* %a
+ %e = sub int %b, %d
+ ret int %e
+}
diff --git a/test/Analysis/DSGraph/2004-03-10-NoElimLoad.ll b/test/Analysis/DSGraph/2004-03-10-NoElimLoad.ll
new file mode 100644
index 0000000000..3a8e540ef1
--- /dev/null
+++ b/test/Analysis/DSGraph/2004-03-10-NoElimLoad.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -ds-aa -load-vn -gcse -instcombine | llvm-dis | grep sub
+
+void %bar(int* %p) {
+ store int 15, int* %p
+ ret void
+}
+
+int %foo(int* %a) {
+ %b = load int* %a
+ call void %bar(int* %a)
+ %d = load int* %a
+ %e = sub int %b, %d
+ ret int %e
+}