From fa59079c3c39e895c882a3d190f56bda365b96ab Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 18 Feb 2003 19:55:31 +0000 Subject: [PATCH] Add new testcases git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5591 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/add.ll | 12 ++++++++++++ test/Transforms/InstCombine/sub.ll | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll index 70bb85a6c84..19fa6261cdd 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 8b164cb51e5..0dd2b7d930c 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 +} + -- 2.34.1