summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-27 06:35:11 +0000
committerChris Lattner <sabre@nondot.org>2004-07-27 06:35:11 +0000
commita9db34f13ce0674488a3470ceb4a2760b3f3b030 (patch)
tree54d4696449739aa4a00cacdd214adc092089d0ef /test
parent059f5a5e0579e8e45748ef1404612cfabe61c01c (diff)
downloadllvm-a9db34f13ce0674488a3470ceb4a2760b3f3b030.tar.gz
llvm-a9db34f13ce0674488a3470ceb4a2760b3f3b030.tar.bz2
llvm-a9db34f13ce0674488a3470ceb4a2760b3f3b030.tar.xz
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/GlobalsModRef/purecse.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/GlobalsModRef/purecse.ll b/test/Analysis/GlobalsModRef/purecse.ll
new file mode 100644
index 0000000000..17e6a0a521
--- /dev/null
+++ b/test/Analysis/GlobalsModRef/purecse.ll
@@ -0,0 +1,15 @@
+; Test that pure functions are cse'd away
+
+; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine -adce| llvm-dis | not grep call
+
+int %pure(int %X) {
+ %Y = add int %X, 1
+ ret int %Y
+}
+
+int %test(int %X) {
+ %A = call int %pure(int %X)
+ %B = call int %pure(int %X)
+ %C = sub int %A, %B
+ ret int %C
+}