aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-05-06 14:59:13 +0200
committerSverker Eriksson <[email protected]>2015-05-06 14:59:13 +0200
commitd4ad455c16a85ee6103d5916ff91cdda31247ca9 (patch)
tree9672b84e0654b5d73f2eb573f7a8fd352a643664 /lib/hipe/test
parent0440e0e45835de5adbe790f9437492d734c6c4e1 (diff)
parent2a3349420d33a298aa02b176100f385c0ab31c99 (diff)
downloadotp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.tar.gz
otp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.tar.bz2
otp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.zip
Merge branch 'sverk/hipe_match_wbin/OTP-12667'
* sverk/hipe_match_wbin/OTP-12667: erts: Add debug assertions for match state sanity hipe: Add test for matching of writable binary erts,hipe: Optimize away calls to emasculate_binary erts,hipe: Fix bug in binary matching of writable binary Conflicts: erts/emulator/hipe/hipe_bif0.c
Diffstat (limited to 'lib/hipe/test')
-rw-r--r--lib/hipe/test/bs_SUITE_data/bs_match.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_match.erl b/lib/hipe/test/bs_SUITE_data/bs_match.erl
index 8194d878b8..7bc93a316b 100644
--- a/lib/hipe/test/bs_SUITE_data/bs_match.erl
+++ b/lib/hipe/test/bs_SUITE_data/bs_match.erl
@@ -12,7 +12,8 @@
test() ->
Funs = [fun test_aligned/0, fun test_unaligned/0,
- fun test_zero_tail/0, fun test_integer_matching/0],
+ fun test_zero_tail/0, fun test_integer_matching/0,
+ fun test_writable_bin/0],
lists:foreach(fun (F) -> ok = F() end, Funs).
%%-------------------------------------------------------------------
@@ -173,3 +174,14 @@ test_dynamic_integer_matching(N) ->
<<12:N/integer, 0:S>> = <<12:N/integer, 0:S>>,
<<12:N/integer-little, 0:S>> = <<12:N/integer-little, 0:S>>,
ok.
+
+test_writable_bin() ->
+ test_writable_bin(<<>>, 0),
+ ok.
+
+test_writable_bin(Bin, 128) ->
+ Bin;
+test_writable_bin(Bin0, N) when N < 128 ->
+ Bin1 = <<Bin0/binary, N>>,
+ <<_/utf8, _/binary>> = Bin1,
+ test_writable_bin(Bin1, N+1).