Skip to content

Commit a57e400

Browse files
committed
Check that division by zero in fastmath doesn't throw
1 parent b7b29e6 commit a57e400

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/fastmath.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,8 @@ fm_fast_64_upd(x) = @fastmath (r=x; r+=eps64_2; r+=eps64_2)
6060
@test @fastmath(cmp(two,two)) == cmp(two,two)
6161
@test @fastmath(cmp(two,three)) == cmp(two,three)
6262
@test @fastmath(cmp(three,two)) == cmp(three,two)
63-
if Sys.ARCH === :powerpc64le || Sys.ARCH === :ppc64le
64-
@test @fastmath(one/zero) == convert(T,NaN)
65-
@test @fastmath(-one/zero) == -convert(T,NaN)
66-
else
67-
@test @fastmath(one/zero) == convert(T,Inf)
68-
@test @fastmath(-one/zero) == -convert(T,Inf)
69-
end
63+
@test @fastmath(one/zero) != one # must not throw
64+
@test @fastmath(-one/zero) != one # must not throw
7065
@test isnan(@fastmath(zero/zero)) # must not throw
7166

7267
for x in (zero, two, convert(T, Inf), convert(T, NaN))

0 commit comments

Comments
 (0)