aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/big_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-10 11:46:48 +0200
committerBjörn Gustavsson <[email protected]>2017-08-11 13:44:47 +0200
commit8c0569d2b5c26545cb7abd9063a1abda7ebd13e9 (patch)
treef642c3dbed4f45c217d7312888cfba08b4fd254e /erts/emulator/test/big_SUITE.erl
parent81a6adab693a75f89bc87911ac23a21308673d2d (diff)
downloadotp-8c0569d2b5c26545cb7abd9063a1abda7ebd13e9.tar.gz
otp-8c0569d2b5c26545cb7abd9063a1abda7ebd13e9.tar.bz2
otp-8c0569d2b5c26545cb7abd9063a1abda7ebd13e9.zip
Make '0 bsl BigNumber' consistently succeed
'0 bsl 134217728' would fail with a system limit exception on a 32-bit BEAM machine, but not on a 64-bit BEAM machine. Smaller values on the right would always work. Make erlang:bsl(0, BigNumber) always return 0 to make for consistency. (The previous commit accidentally did that change for '0 bsl BigNumber'.)
Diffstat (limited to 'erts/emulator/test/big_SUITE.erl')
-rw-r--r--erts/emulator/test/big_SUITE.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl
index c308760211..5939d024ae 100644
--- a/erts/emulator/test/big_SUITE.erl
+++ b/erts/emulator/test/big_SUITE.erl
@@ -339,6 +339,13 @@ system_limit(Config) when is_list(Config) ->
{'EXIT',{system_limit,_}} = (catch apply(erlang, id('bsl'), [Maxbig,2])),
{'EXIT',{system_limit,_}} = (catch id(1) bsl (1 bsl 45)),
{'EXIT',{system_limit,_}} = (catch id(1) bsl (1 bsl 69)),
+
+ %% There should be no system_limit exception when shifting a zero.
+ 0 = id(0) bsl (1 bsl 128),
+ 0 = id(0) bsr -(1 bsl 128),
+ Erlang = id(erlang),
+ 0 = Erlang:'bsl'(id(0), 1 bsl 128),
+ 0 = Erlang:'bsr'(id(0), -(1 bsl 128)),
ok.
maxbig() ->