summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-02-03 06:46:41 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-02-03 06:46:41 +0000
commita5229887cf148a2ef8232cc827f896251928d423 (patch)
tree9bcb5878afc74dfac3956bc99dec7e0cb42702b8 /test
parent5ccc7225db0cb4d738045ade8e8c38d5345ac08a (diff)
downloadllvm-a5229887cf148a2ef8232cc827f896251928d423.tar.gz
llvm-a5229887cf148a2ef8232cc827f896251928d423.tar.bz2
llvm-a5229887cf148a2ef8232cc827f896251928d423.tar.xz
Added a (store (op (load ...) ...) ...) folding test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/store_op_load_fold.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/store_op_load_fold.ll b/test/CodeGen/X86/store_op_load_fold.ll
new file mode 100644
index 0000000000..64d8da59ee
--- /dev/null
+++ b/test/CodeGen/X86/store_op_load_fold.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep 'mov'
+;
+; Test the add and load are folded into the store instruction.
+
+target triple = "i686-pc-linux-gnu"
+
+%X = weak global short 0
+
+void %foo() {
+ %tmp.0 = load short* %X
+ %tmp.3 = add short %tmp.0, 329
+ store short %tmp.3, short* %X
+ ret void
+}