Skip to content

Commit 600d363

Browse files
authored
Merge pull request #18431 from JuliaLang/yyc/tests/cov-meta
Fix metadata count test with inline coverage on
2 parents 08f1964 + 28ddae9 commit 600d363

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/parse.jl

+10-4
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,18 @@ end
768768
end
769769

770770
f1_exprs = get_expr_list(@code_typed f1(1))
771-
@test count_meta_loc(f1_exprs) == 0
772-
@test Meta.isexpr(f1_exprs[end], :return)
773-
774771
f2_exprs = get_expr_list(@code_typed f2(1))
775-
@test count_meta_loc(f2_exprs) == 1
772+
773+
@test Meta.isexpr(f1_exprs[end], :return)
776774
@test is_pop_loc(f2_exprs[end - 1])
777775
@test Meta.isexpr(f2_exprs[end], :return)
778776

777+
if Base.JLOptions().code_coverage != 0 && Base.JLOptions().can_inline != 0
778+
@test count_meta_loc(f1_exprs) == 1
779+
@test count_meta_loc(f2_exprs) == 2
780+
else
781+
@test count_meta_loc(f1_exprs) == 0
782+
@test count_meta_loc(f2_exprs) == 1
783+
end
784+
779785
end

0 commit comments

Comments
 (0)