summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-10 23:30:57 +0000
committerDan Gohman <gohman@apple.com>2008-09-10 23:30:57 +0000
commit1df3fd66835453a5516fe3336cd725778b39be97 (patch)
treecb0db8492395c2cba9c05da3f7aadf073062c5be /test
parent8c9c55fb48f2fd07f5a1aad3eb2204ad5af5fe78 (diff)
downloadllvm-1df3fd66835453a5516fe3336cd725778b39be97.tar.gz
llvm-1df3fd66835453a5516fe3336cd725778b39be97.tar.bz2
llvm-1df3fd66835453a5516fe3336cd725778b39be97.tar.xz
Fix an icmp+sdiv optimization to check for and handle an overflow
condition. This fixes PR2740. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/div-cmp-overflow.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/div-cmp-overflow.ll b/test/Transforms/InstCombine/div-cmp-overflow.ll
new file mode 100644
index 0000000000..9276c96479
--- /dev/null
+++ b/test/Transforms/InstCombine/div-cmp-overflow.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sdiv
+; PR2740
+
+define i1 @func_75(i32 %i2) nounwind {
+ %i3 = sdiv i32 %i2, -1328634635
+ %i4 = icmp eq i32 %i3, -1
+ ret i1 %i4
+}