aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/bs_SUITE_data/bs_construct.erl
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-10-15 17:03:26 +0200
committerZandra <[email protected]>2015-10-15 17:03:26 +0200
commit2a3781b127ccd4b2065eed77de03a8a9a418f1f7 (patch)
tree76ab71f741368a8c359e3045d6b477311f3c5923 /lib/hipe/test/bs_SUITE_data/bs_construct.erl
parent90fcd9fdc8defdc15bfa5630ac4ece501a810d20 (diff)
parentd94a8ef6dc136dd2eedf3c3ad4bc053ca8fdd1b0 (diff)
downloadotp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.tar.gz
otp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.tar.bz2
otp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.zip
Merge branch 'kostis/hipe-bs-construct-zero-size' into maint
* kostis/hipe-bs-construct-zero-size: Fix edge case of Size = 0 in bs_put_integer OTP-13048
Diffstat (limited to 'lib/hipe/test/bs_SUITE_data/bs_construct.erl')
-rw-r--r--lib/hipe/test/bs_SUITE_data/bs_construct.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_construct.erl b/lib/hipe/test/bs_SUITE_data/bs_construct.erl
index 9cc9ac848c..37a54c1981 100644
--- a/lib/hipe/test/bs_SUITE_data/bs_construct.erl
+++ b/lib/hipe/test/bs_SUITE_data/bs_construct.erl
@@ -13,6 +13,7 @@ test() ->
ok = bs5(),
16#10000008 = bit_size(large_bin(1, 2, 3, 4)),
ok = bad_ones(),
+ ok = zero_width(),
ok.
%%--------------------------------------------------------------------
@@ -126,3 +127,18 @@ bad_ones() ->
Bin123 = <<1,2,3>>,
?FAIL(<<Bin123/float>>),
ok.
+
+%%--------------------------------------------------------------------
+%% Taken from the emulator bs_construct_SUITE - seg faulted till 18.1
+
+zero_width() ->
+ Z = id(0),
+ Small = id(42),
+ Big = id(1 bsl 128), % puts stuff on the heap
+ <<>> = <<Small:Z>>,
+ <<>> = <<Small:0>>,
+ <<>> = <<Big:Z>>,
+ <<>> = <<Big:0>>,
+ ok.
+
+id(X) -> X.