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 | 422276fb4418bdc597adbd266a1a90ea049938e5 (patch) | |
tree | cf70b6fd7f79a4d6fa736caf13eec85ca817d1f0 /test/Transforms | |
parent | b533eb62feffeac0b695b855f6c839a5c5188b49 (diff) |
[InstCombine] add test for frem with 0.0 (PR34870); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/rem.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/rem.ll b/test/Transforms/InstCombine/rem.ll index 4e90b337b09..348190df5b1 100644 --- a/test/Transforms/InstCombine/rem.ll +++ b/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 +} + |