summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/apint-sub.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/apint-sub.ll')
-rw-r--r--test/Transforms/InstCombine/apint-sub.ll8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/Transforms/InstCombine/apint-sub.ll b/test/Transforms/InstCombine/apint-sub.ll
index 12f366de7f..2ff763c9f5 100644
--- a/test/Transforms/InstCombine/apint-sub.ll
+++ b/test/Transforms/InstCombine/apint-sub.ll
@@ -3,7 +3,7 @@
;
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
-; RUN: grep -v {sub i19 %Cok, %Bok} | not grep sub
+; RUN: grep -v {sub i19 %Cok, %Bok} | grep -v {sub i25 0, %Aok} | not grep sub
; END.
define i23 @test1(i23 %A) {
@@ -107,8 +107,10 @@ define i51 @test16(i51 %A) {
ret i51 %Y
}
-define i25 @test17(i25 %A) {
- %B = sub i25 0, %A ; <i25> [#uses=1]
+; Can't fold subtract here because negation it might oveflow.
+; PR3142
+define i25 @test17(i25 %Aok) {
+ %B = sub i25 0, %Aok ; <i25> [#uses=1]
%C = sdiv i25 %B, 1234 ; <i25> [#uses=1]
ret i25 %C
}