diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-11-02 02:41:50 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-11-02 02:41:50 +0000 |
commit | 8e39432ea9751917d5cef1f18f6c32382c384d58 (patch) | |
tree | 9d162738d97b827638c42c0c8d9526395f19726a /test | |
parent | 21440acc06b6451ad5c0678e3f15ee08b1f1d206 (diff) | |
download | llvm-8e39432ea9751917d5cef1f18f6c32382c384d58.tar.gz llvm-8e39432ea9751917d5cef1f18f6c32382c384d58.tar.bz2 llvm-8e39432ea9751917d5cef1f18f6c32382c384d58.tar.xz |
Fix demanded bits analysis with srem by negative number. Based on a patch
by Richard Osborne.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll b/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll new file mode 100644 index 0000000000..46e98eb362 --- /dev/null +++ b/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 true} +; PR2993 + +define i1 @foo(i32 %x) { + %1 = srem i32 %x, -1 + %2 = icmp eq i32 %1, 0 + ret i1 %2 +} |