summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-12-26 22:12:20 +0000
committerSanjay Patel <spatel@rotateright.com>2017-12-26 22:12:20 +0000
commitf186f082c569f37f10f8ef73ecad4b27d9359cab (patch)
treee629adefeeb7bd0c01b51392e655da93dbd8e863 /test/Transforms
parent422276fb4418bdc597adbd266a1a90ea049938e5 (diff)
[InstCombine] fix miscompile of frem with 0.0 operand (PR34870)
We might want to select NAN here or do this transform with fast-math, but this should at least fix the miscompile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/rem.ll5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/Transforms/InstCombine/rem.ll b/test/Transforms/InstCombine/rem.ll
index 348190df5b1..f71a0fb4c62 100644
--- a/test/Transforms/InstCombine/rem.ll
+++ b/test/Transforms/InstCombine/rem.ll
@@ -594,11 +594,12 @@ define <2 x i32> @test23(<2 x i32> %A) {
ret <2 x i32> %mul
}
-; FIXME: FP division-by-zero is not UB.
+; FP division-by-zero is not UB.
define double @PR34870(i1 %cond, double %x, double %y) {
; CHECK-LABEL: @PR34870(
-; CHECK-NEXT: [[FMOD:%.*]] = frem double %x, %y
+; CHECK-NEXT: [[SEL:%.*]] = select i1 %cond, double %y, double 0.000000e+00
+; CHECK-NEXT: [[FMOD:%.*]] = frem double %x, [[SEL]]
; CHECK-NEXT: ret double [[FMOD]]
;
%sel = select i1 %cond, double %y, double 0.0