aboutsummaryrefslogtreecommitdiffstats
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
commitb80d5614b02a56709f72656df8ace6415ab64f4a (patch)
treecb0db8492395c2cba9c05da3f7aadf073062c5be /test
parentd8d71075c38150f68d1c9f229c318ecf7398be4d (diff)
downloadexternal_llvm-b80d5614b02a56709f72656df8ace6415ab64f4a.zip
external_llvm-b80d5614b02a56709f72656df8ace6415ab64f4a.tar.gz
external_llvm-b80d5614b02a56709f72656df8ace6415ab64f4a.tar.bz2
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 0000000..9276c96
--- /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
+}