Skip to content

Commit

Permalink
add an extra fastmath test
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Mar 5, 2020
1 parent bdfd585 commit 5ee8ad6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
@test all(Tuple(@fastmath v+1.0) .≈ Tuple(v+1.0))
@test all(Tuple(@fastmath 1.0+v) .≈ Tuple(1.0+v))
@test all(Tuple(@fastmath -v) .≈ Tuple(-v))
f = v -> @fastmath v + v
# Test that v+v is rewritten as v * 2.0 (change test if optimization changes)
@test occursin(r"fmul fast <4 x double> %[0-9]*, <double 2.000000e+00", llvm_ir(f, (v,)))
end

@testset "Gather and scatter function" begin
Expand Down

0 comments on commit 5ee8ad6

Please sign in to comment.