[InstCombine] add test for frem with 0.0 (PR34870); NFC

llvm-svn: 321460
This commit is contained in:
Sanjay Patel 2017-12-26 22:06:57 +00:00
parent 1dd7856af5
commit 546c43fd1a
1 changed files with 13 additions and 0 deletions

View File

@ -593,3 +593,16 @@ define <2 x i32> @test23(<2 x i32> %A) {
%mul = srem <2 x i32> %and, <i32 2147483647, i32 2147483647>
ret <2 x i32> %mul
}
; FIXME: 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: ret double [[FMOD]]
;
%sel = select i1 %cond, double %y, double 0.0
%fmod = frem double %x, %sel
ret double %fmod
}