diff options
author | Chris Lattner <sabre@nondot.org> | 2003-03-10 22:43:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-03-10 22:43:56 +0000 |
commit | 1b77300154ca8cbf1594475712811228f898149c (patch) | |
tree | 5953408fa9ef48dd9dd033be8381840b05ae36c5 | |
parent | 1680312867fffeb9369800949b809e0b9e29a914 (diff) |
* Add testcases for associative operators
* Add testcase for or ubyte, 255 which was broken before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5735 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/InstCombine/and.ll | 8 | ||||
-rw-r--r-- | test/Transforms/InstCombine/mul.ll | 6 | ||||
-rw-r--r-- | test/Transforms/InstCombine/or.ll | 16 |
3 files changed, 29 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll index 7dd3d554b6..03b67f57b6 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -42,4 +42,10 @@ int %test7(int %A) { ; A & ~A == 0 %NotA = xor int %A, -1 %B = and int %A, %NotA ret int %B -}
\ No newline at end of file +} + +ubyte %test8(ubyte %A) { ; AND associates + %B = and ubyte %A, 3 + %C = and ubyte %B, 4 + ret ubyte %C +} diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index a0a2808106..962f599892 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -32,3 +32,9 @@ int %test5(int %A) { %B = mul int %A, 8 ret int %B } + +int %test6(ubyte %A) { + %B = mul ubyte %A, 8 + %C = mul ubyte %B, 13 + ret ubyte %C +} diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index 5523f87c4e..7ffd3461bc 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -18,6 +18,11 @@ int %test2(int %A) { ret int %B } +ubyte %test2a(ubyte %A) { + %B = or ubyte %A, 255 + ret ubyte %B +} + bool %test3(bool %A) { %B = or bool %A, false ret bool %B @@ -75,3 +80,14 @@ uint %test13(uint %A) { ; (A|B)^B == A & (~B) %r = xor uint %t1, 123 ret uint %r } + +ubyte %test14(ubyte %A) { + %B = or ubyte %A, 254 + %C = or ubyte %B, 1 + ret ubyte %C +} +ubyte %test15(ubyte %A) { + %B = xor ubyte %A, 17 + %C = xor ubyte %B, 17 + ret ubyte %C +} |