Add new testcases
authorChris Lattner <sabre@nondot.org>
Tue, 18 Feb 2003 19:55:31 +0000 (19:55 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Feb 2003 19:55:31 +0000 (19:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5591 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/add.ll
test/Transforms/InstCombine/sub.ll

index 70bb85a6c849c0e9514f1ef1b806accf5e25e9c1..19fa6261cdd51a71f95a94e334a065ef2c11ee79 100644 (file)
@@ -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
+}
+
index 8b164cb51e5ac486915911cbf6c226a949d0c71f..0dd2b7d930c42a156ff9a33e24c7e09aa8325875 100644 (file)
@@ -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
+}
+