summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-18 19:55:31 +0000
committerChris Lattner <sabre@nondot.org>2003-02-18 19:55:31 +0000
commitfa59079c3c39e895c882a3d190f56bda365b96ab (patch)
tree93f3220280a8a5b406042604dadea10639dd8e05 /test/Transforms/InstCombine
parentb19fa8d3d6b3623cc14872c9ac5aa23da5c81c60 (diff)
downloadllvm-fa59079c3c39e895c882a3d190f56bda365b96ab.tar.gz
llvm-fa59079c3c39e895c882a3d190f56bda365b96ab.tar.bz2
llvm-fa59079c3c39e895c882a3d190f56bda365b96ab.tar.xz
Add new testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/add.ll12
-rw-r--r--test/Transforms/InstCombine/sub.ll12
2 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll
index 70bb85a6c8..19fa6261cd 100644
--- a/test/Transforms/InstCombine/add.ll
+++ b/test/Transforms/InstCombine/add.ll
@@ -39,3 +39,15 @@ int %test5(int %A, int %B) {
ret int %D
}
+int %test6(int %A) {
+ %B = mul int 7, %A
+ %C = add int %B, %A ; C = 7*A+A == 8*A == A << 3
+ ret int %C
+}
+
+int %test7(int %A) {
+ %B = mul int 7, %A
+ %C = add int %A, %B ; C = A+7*A == 8*A == A << 3
+ ret int %C
+}
+
diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll
index 8b164cb51e..0dd2b7d930 100644
--- a/test/Transforms/InstCombine/sub.ll
+++ b/test/Transforms/InstCombine/sub.ll
@@ -47,3 +47,15 @@ int %test7(int %A) {
ret int %B
}
+int %test8(int %A) {
+ %B = mul int 9, %A
+ %C = sub int %B, %A ; C = 9*A-A == A*8 == A << 3
+ ret int %C
+}
+
+int %test9(int %A) {
+ %B = mul int 3, %A
+ %C = sub int %A, %B ; C = A-3*A == A*-2
+ ret int %C
+}
+