diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-23 21:48:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-23 21:48:26 +0000 |
commit | 8186a94e089c6672842f007db2fff267e83b052d (patch) | |
tree | 862f56146170d4cce2af8a40647b78185a87a7a8 /test/Transforms/InstCombine/cast.ll | |
parent | 031a112747a480a4dea1cd5a02de88d42b091225 (diff) | |
download | llvm-8186a94e089c6672842f007db2fff267e83b052d.tar.gz llvm-8186a94e089c6672842f007db2fff267e83b052d.tar.bz2 llvm-8186a94e089c6672842f007db2fff267e83b052d.tar.xz |
Test cases for when casts to bool can be eliminated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/cast.ll')
-rw-r--r-- | test/Transforms/InstCombine/cast.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index ac92b959ef..2ef6240a75 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -68,3 +68,16 @@ short %test10(short %A) { %c2 = cast uint %c1 to short ret short %c2 } + +bool %test11(ubyte %A, ubyte %B) { + %C = sub ubyte %A, %B + %D = cast ubyte %C to bool ; == setne A, B + ret bool %D +} + +bool %test12(ubyte %A) { + %B = add ubyte %A, 255 + %C = cast ubyte %B to bool ; === A != 1 + ret bool %C +} + |