Skip to content

Commit

Permalink
Merge branch 'bjorn/cuddle-with-tests'
Browse files Browse the repository at this point in the history
* bjorn/cuddle-with-tests:
  Improve coverage of beam_ssa_bool
  beam_SUITE: Run the fconv/1 test case
  • Loading branch information
bjorng committed Oct 26, 2023
2 parents 95de100 + 261ba04 commit 70e10b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions erts/emulator/test/beam_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].

all() ->
[packed_registers, apply_last, apply_last_bif,
heap_sizes, big_lists,
heap_sizes, big_lists, fconv,
select_val, select_tuple_arity,
swap_temp_apply, beam_init_yregs].

Expand Down Expand Up @@ -284,7 +284,10 @@ do_fconv(atom, Float) when is_float(Float) ->
do_fconv(nil, Float) when is_float(Float) ->
Float + [];
do_fconv(tuple_literal, Float) when is_float(Float) ->
Float + {a,b}.
Float + {a,b};
do_fconv(A, B) when is_float(A), is_float(B) ->
A + B.


select_val(Config) when is_list(Config) ->
Mod = ?FUNCTION_NAME,
Expand Down
8 changes: 8 additions & 0 deletions lib/compiler/test/guard_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,9 @@ beam_ssa_bool_coverage() ->
error = beam_ssa_bool_coverage_2(false),
error = beam_ssa_bool_coverage_2(42),

error = beam_ssa_bool_coverage_3(42),
error = beam_ssa_bool_coverage_3(a),

ok.

collect_modifiers([H | T], Buffer)
Expand All @@ -3159,6 +3162,11 @@ beam_ssa_bool_coverage_2(A) when is_pid(A) andalso true; A ->
beam_ssa_bool_coverage_2(_) ->
error.

beam_ssa_bool_coverage_3(A) when ok; ((ok =< A + 1) or false) and true orelse ok ->
ok;
beam_ssa_bool_coverage_3(_) ->
error.

gh_6164() ->
true = do_gh_6164(id([])),
{'EXIT',{{case_clause,42},_}} = catch do_gh_6164(id(0)),
Expand Down

0 comments on commit 70e10b3

Please sign in to comment.