diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-12-26 22:06:57 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-12-26 22:06:57 +0000 |
| commit | 546c43fd1a64b87729ca1120069e171eaef2c3c6 (patch) | |
| tree | e541a08b6cd0fd58d441c8e28f64306c7a397ef3 /llvm/test/Transforms | |
| parent | 1dd7856af58a8f6aa1582bc5e5da6a61cbbb16c6 (diff) | |
| download | bcm5719-llvm-546c43fd1a64b87729ca1120069e171eaef2c3c6.tar.gz bcm5719-llvm-546c43fd1a64b87729ca1120069e171eaef2c3c6.zip | |
[InstCombine] add test for frem with 0.0 (PR34870); NFC
llvm-svn: 321460
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/rem.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/rem.ll b/llvm/test/Transforms/InstCombine/rem.ll index 4e90b337b09..348190df5b1 100644 --- a/llvm/test/Transforms/InstCombine/rem.ll +++ b/llvm/test/Transforms/InstCombine/rem.ll @@ -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 +} + |

