Skip to content

Commit

Permalink
Workaround for --check-bounds=no case in __test_ir.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jul 20, 2019
1 parent 75cc420 commit e19bc24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/__test_ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ twice(x) = 2x
@test mapbb(twice, [1:3;], Val(false)) == [2, 4, 6]

ir_noinbounds = llvm_ir(mapbb, (twice, Float64[], Val(false)))
@test nmatches(r"fmul <4 x double>", ir_noinbounds) == 0
if Base.JLOptions().check_bounds == 2 # --check-bounds=no
@test nmatches(r"fmul <4 x double>", ir_noinbounds) >= 4
else
@test nmatches(r"fmul <4 x double>", ir_noinbounds) == 0
end
ir_inbounds = llvm_ir(mapbb, (twice, Float64[], Val(true)))
@test nmatches(r"fmul <4 x double>", ir_inbounds) >= 4
end

0 comments on commit e19bc24

Please sign in to comment.