diff options
author | Zandra <[email protected]> | 2016-02-02 11:35:58 +0100 |
---|---|---|
committer | Zandra <[email protected]> | 2016-02-02 11:35:58 +0100 |
commit | 1a1eaec544987f439061622f0177e424dfd6306a (patch) | |
tree | 05454189fc353121a038027255a6559e7bd2eaa2 /lib/hipe/test/bs_SUITE_data/bs_add.erl | |
parent | b937e14a5b656b025f9b369656bfd03dadd481b5 (diff) | |
parent | 61ef7511c5ffae0b061d7cc45e9d564b02b891db (diff) | |
download | otp-1a1eaec544987f439061622f0177e424dfd6306a.tar.gz otp-1a1eaec544987f439061622f0177e424dfd6306a.tar.bz2 otp-1a1eaec544987f439061622f0177e424dfd6306a.zip |
Merge branch 'maint'
Conflicts:
erts/emulator/beam/beam_emu.c
Diffstat (limited to 'lib/hipe/test/bs_SUITE_data/bs_add.erl')
-rw-r--r-- | lib/hipe/test/bs_SUITE_data/bs_add.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_add.erl b/lib/hipe/test/bs_SUITE_data/bs_add.erl index af5a3b2f23..4b92e6b413 100644 --- a/lib/hipe/test/bs_SUITE_data/bs_add.erl +++ b/lib/hipe/test/bs_SUITE_data/bs_add.erl @@ -2,7 +2,7 @@ %%------------------------------------------------------------------------- %% The guard in f/3 revealed a problem in the translation of the 'bs_add' %% BEAM instruction to Icode. The fail label was not properly translated. -%% Fixed 3/2/2011. +%% Fixed 3/2/2011. Then in 2015 we found another issue: g/2. Also fixed. %%------------------------------------------------------------------------- -module(bs_add). @@ -10,9 +10,17 @@ test() -> 42 = f(<<12345:16>>, 4711, <<42>>), + true = g(<<1:13>>, 3), %% was handled OK, but + false = g(<<>>, gurka), %% this one leaked badarith ok. f(Bin, A, B) when <<A:9, B:7/binary>> == Bin -> gazonk; f(Bin, _, _) when is_binary(Bin) -> 42. + +%% Complex way of testing (bit_size(Bin) + Len) rem 8 =:= 0 +g(Bin, Len) when is_binary(<<Bin/binary-unit:1, 123:Len>>) -> + true; +g(_, _) -> + false. |