diff options
author | Chris Lattner <sabre@nondot.org> | 2003-07-24 19:44:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-07-24 19:44:51 +0000 |
commit | 12642fda090658215b1f20c7d9cecb37b5b6560c (patch) | |
tree | 495908226a9985eb87fa3164344d42033d19cf56 /test/Transforms/InstCombine | |
parent | d2a0896832a51a42dca2395c54b70330e9e9af18 (diff) | |
download | llvm-12642fda090658215b1f20c7d9cecb37b5b6560c.tar.gz llvm-12642fda090658215b1f20c7d9cecb37b5b6560c.tar.bz2 llvm-12642fda090658215b1f20c7d9cecb37b5b6560c.tar.xz |
More testcases, which I'll implement later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/add.ll | 5 | ||||
-rw-r--r-- | test/Transforms/InstCombine/and.ll | 13 | ||||
-rw-r--r-- | test/Transforms/InstCombine/or.ll | 7 |
3 files changed, 25 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll index e3b9c98f31..10040f972c 100644 --- a/test/Transforms/InstCombine/add.ll +++ b/test/Transforms/InstCombine/add.ll @@ -55,3 +55,8 @@ int %test8(int %A, int %B) { ; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1 ret int %C } +int %test9(int %A) { + %B = shl int %A, ubyte 4 + %C = add int %B, %B ; === shl int %A, 5 + ret int %C +} diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll index 3eeac3b17f..23bd2df397 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -74,4 +74,17 @@ uint %test11(uint %A, uint* %P) { ret uint %D } +bool %test12(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = setle uint %A, %B + %D = and bool %C1, %C2 ; (A < B) & (A <= B) === (A < B) + ret bool %D +} + +bool %test13(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = setgt uint %A, %B + %D = and bool %C1, %C2 ; (A < B) & (A > B) === false + ret bool %D +} diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index c4a62283f3..43ed83d618 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -93,3 +93,10 @@ bool %test14(uint %A, uint %B) { ret bool %D } +bool %test15(uint %A, uint %B) { + %C1 = setlt uint %A, %B + %C2 = seteq uint %A, %B + %D = or bool %C1, %C2 ; (A < B) | (A == B) === A <= B + ret bool %D +} + |