Skip to content

Commit

Permalink
Remove debug output; add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Dec 8, 2015
1 parent 9a8cba6 commit 2bd020c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion base/fastmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function make_fastmath(expr::Expr)
end
op = get(rewrite_op, expr.head, :nothing)
if op !== :nothing
info("FM: rewriting op $(expr.head) with $op")
var = expr.args[1]
rhs = expr.args[2]
if isa(var, Symbol)
Expand Down
8 changes: 8 additions & 0 deletions test/fastmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# fast math

# check expansions

@test macroexpand(:(@fastmath 1+2)) == :(Base.FastMath.add_fast(1,2))
@test macroexpand(:(@fastmath +)) == :(Base.FastMath.add_fast)
@test macroexpand(:(@fastmath min(1))) == :(Base.FastMath.min_fast(1))
@test macroexpand(:(@fastmath min)) == :(Base.FastMath.min_fast)
@test macroexpand(:(@fastmath x.min)) == :(x.min)

# basic arithmetic

const one32 = one(Float32)
Expand Down

0 comments on commit 2bd020c

Please sign in to comment.