aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-25 09:31:21 +0100
committerBjörn Gustavsson <[email protected]>2017-11-27 10:20:19 +0100
commit5f27079c58ac9705b5e1c81cd5a14c1d245afd66 (patch)
treee7db0c2fbce27c66e32a2017864650d000f82de9
parent756fc181cf8835268bf9e3b963dcda294e0ff2a3 (diff)
downloadotp-5f27079c58ac9705b5e1c81cd5a14c1d245afd66.tar.gz
otp-5f27079c58ac9705b5e1c81cd5a14c1d245afd66.tar.bz2
otp-5f27079c58ac9705b5e1c81cd5a14c1d245afd66.zip
Cover more code in beam_bsm:btb_opt_1/3
-rw-r--r--lib/compiler/test/bs_match_SUITE.erl18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl
index ad48d4c0b7..e6fa80e143 100644
--- a/lib/compiler/test/bs_match_SUITE.erl
+++ b/lib/compiler/test/bs_match_SUITE.erl
@@ -39,7 +39,8 @@
match_string_opt/1,select_on_integer/1,
map_and_binary/1,unsafe_branch_caching/1,
bad_literals/1,good_literals/1,constant_propagation/1,
- parse_xml/1,get_payload/1,escape/1,num_slots_different/1]).
+ parse_xml/1,get_payload/1,escape/1,num_slots_different/1,
+ check_bitstring_list/1]).
-export([coverage_id/1,coverage_external_ignore/2]).
@@ -71,7 +72,8 @@ groups() ->
match_string_opt,select_on_integer,
map_and_binary,unsafe_branch_caching,
bad_literals,good_literals,constant_propagation,parse_xml,
- get_payload,escape,num_slots_different]}].
+ get_payload,escape,num_slots_different,
+ check_bitstring_list]}].
init_per_suite(Config) ->
@@ -1572,6 +1574,18 @@ lgettext(<<"de">>, <<"navigation">>, <<"Results">>) ->
lgettext(<<"de">>, <<"navigation">>, <<"Resources">>) ->
{ok, <<"Ressourcen">>}.
+%% Cover more code in beam_bsm.
+check_bitstring_list(_Config) ->
+ true = check_bitstring_list(<<1:1,0:1,1:1,1:1>>, [1,0,1,1]),
+ false = check_bitstring_list(<<1:1,0:1,1:1,1:1>>, [0]),
+ ok.
+
+check_bitstring_list(<<H:1,T1/bitstring>>, [H|T2]) ->
+ check_bitstring_list(T1, T2);
+check_bitstring_list(<<>>, []) ->
+ true;
+check_bitstring_list(_, _) ->
+ false.
check(F, R) ->
R = F().