diff options
author | Björn Gustavsson <[email protected]> | 2018-11-01 08:18:19 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-06 10:16:54 +0100 |
commit | 1565b1518f77b2c078c59c2554305b7dca668f72 (patch) | |
tree | 7f548db0510632bc58fc6b6daff5d6fdd2291f44 /lib/compiler/test | |
parent | 4ae91649adf139aa6b2890065006203e14775a70 (diff) | |
download | otp-1565b1518f77b2c078c59c2554305b7dca668f72.tar.gz otp-1565b1518f77b2c078c59c2554305b7dca668f72.tar.bz2 otp-1565b1518f77b2c078c59c2554305b7dca668f72.zip |
beam_trim: Handle the new binary matching instructions
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/bs_match_SUITE.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 0c6db96081..01f302ad21 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -742,6 +742,10 @@ coverage(Config) when is_list(Config) -> binary = coverage_bitstring(<<7>>), bitstring = coverage_bitstring(<<7:4>>), other = coverage_bitstring([a]), + + {done,<<17,53>>,[253,155,200]} = + coverage_trim(<<253,155,200,17,53>>, e0, e1, e2, e3, []), + ok. coverage_fold(Fun, Acc, <<H,T/binary>>) -> @@ -836,6 +840,14 @@ coverage_bitstring(Bin) when is_binary(Bin) -> binary; coverage_bitstring(<<_/bitstring>>) -> bitstring; coverage_bitstring(_) -> other. +coverage_trim(<<C:8,T/binary>> = Bin, E0, E1, E2, E3, Acc) -> + case id(C > 128) of + true -> + coverage_trim(T, E0, E1, E2, E3, [C|Acc]); + false -> + {done,Bin,lists:reverse(Acc)} + end. + multiple_uses(Config) when is_list(Config) -> {344,62879,345,<<245,159,1,89>>} = multiple_uses_1(<<1,88,245,159,1,89>>), true = multiple_uses_2(<<0,0,197,18>>), |