summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/sub.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/sub.ll')
-rw-r--r--test/Transforms/InstCombine/sub.ll12
1 files changed, 12 insertions, 0 deletions
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
+}
+