aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-08 21:41:18 +0000
committerChris Lattner <sabre@nondot.org>2005-05-08 21:41:18 +0000
commit22d06312a903be84ff9ec6ad64500e5ed24a0c94 (patch)
tree6e1a4d64ccda0db417c513808d6db29c6e726a28
parent6f156856ca23394122f39d92fe74eec40a1f7c27 (diff)
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21787 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/Reassociate/mul-neg-add.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/Reassociate/mul-neg-add.ll b/test/Transforms/Reassociate/mul-neg-add.ll
new file mode 100644
index 0000000000..79eeb198ac
--- /dev/null
+++ b/test/Transforms/Reassociate/mul-neg-add.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep 'sub int 0'
+
+int %test(int %X, int %Y, int %Z) {
+ %A = sub int 0, %X
+ %B = mul int %A, %Y
+ %C = add int %B, %Z ; (-X)*Y + Z -> Z-X*Y
+ ret int %C
+}