Skip to content

Commit

Permalink
Merge pull request #18431 from JuliaLang/yyc/tests/cov-meta
Browse files Browse the repository at this point in the history
Fix metadata count test with inline coverage on
  • Loading branch information
yuyichao authored Sep 10, 2016
2 parents 08f1964 + 28ddae9 commit 600d363
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,18 @@ end
end

f1_exprs = get_expr_list(@code_typed f1(1))
@test count_meta_loc(f1_exprs) == 0
@test Meta.isexpr(f1_exprs[end], :return)

f2_exprs = get_expr_list(@code_typed f2(1))
@test count_meta_loc(f2_exprs) == 1

@test Meta.isexpr(f1_exprs[end], :return)
@test is_pop_loc(f2_exprs[end - 1])
@test Meta.isexpr(f2_exprs[end], :return)

if Base.JLOptions().code_coverage != 0 && Base.JLOptions().can_inline != 0
@test count_meta_loc(f1_exprs) == 1
@test count_meta_loc(f2_exprs) == 2
else
@test count_meta_loc(f1_exprs) == 0
@test count_meta_loc(f2_exprs) == 1
end

end

0 comments on commit 600d363

Please sign in to comment.