aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/beam_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-01-17 15:29:48 +0100
committerBjörn Gustavsson <[email protected]>2011-01-17 15:29:48 +0100
commitfaef041a446314bb228e0e8c88a09241df2798f1 (patch)
tree728f73a167f50a46b54617a6cc054807064236e9 /erts/emulator/test/beam_SUITE.erl
parent7bc25db7f9a70190a661b2a97734900893d33169 (diff)
parent3f1fce3929cc0cc68d7e5b1ce543bd3f20a31e2b (diff)
downloadotp-faef041a446314bb228e0e8c88a09241df2798f1.tar.gz
otp-faef041a446314bb228e0e8c88a09241df2798f1.tar.bz2
otp-faef041a446314bb228e0e8c88a09241df2798f1.zip
Merge branch 'bjorn/beam-loader/OTP-9030' into dev
* bjorn/beam-loader/OTP-9030: (43 commits) c: Reduce memory footprint erl_posix_msg: Reduce memory footprint Introduce a few more variations of the move instructions Combine a move + jump sequence into the move_jump instruction Optimize and clean-up the exact equality/non-equality instructions Optimize addition of a small integer to a variable Introduce a special instruction for select_val with two values Introduce a few more specialized put_list instructions Eliminate the "put_list c n Dst" instructions Eliminate the specific move_sd instruction Eliminate use of GetArg1() in the badmatch and case_end instructions Eliminate use of GetArg2() in the i_element instruction Eliminate use of GetArg1() in the fast_element instruction Eliminate use of GetArg1() in the jump_on_val* instructions Eliminate use of GetArg1() in the select_val instruction beam_emu: Eliminate sloppy use of tmp_arg1 and tmp_arg2 beam_emu: Don't inline helper functions into process_main() beam_emu: Clean up calling of the error_handler module Simplify a select_val instruction that selects only one value Optimize creation of tuples ...
Diffstat (limited to 'erts/emulator/test/beam_SUITE.erl')
-rw-r--r--erts/emulator/test/beam_SUITE.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl
index 228ff15341..32ac07cb2d 100644
--- a/erts/emulator/test/beam_SUITE.erl
+++ b/erts/emulator/test/beam_SUITE.erl
@@ -20,7 +20,8 @@
-module(beam_SUITE).
-export([all/1, packed_registers/1, apply_last/1, apply_last_bif/1,
- buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1]).
+ buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1,
+ select_val/1]).
-export([applied/2]).
@@ -28,7 +29,7 @@
all(suite) ->
[packed_registers, apply_last, apply_last_bif, buildo_mucho,
- heap_sizes, big_lists].
+ heap_sizes, big_lists, select_val].
%% Verify that apply(M, F, A) is really tail recursive.
@@ -302,3 +303,19 @@ do_fconv(nil, Float) when is_float(Float) ->
Float + [];
do_fconv(tuple_literal, Float) when is_float(Float) ->
Float + {a,b}.
+
+select_val(Config) when is_list(Config) ->
+ ?line zero = do_select_val(0),
+ ?line big = do_select_val(1 bsl 64),
+ ?line integer = do_select_val(42),
+ ok.
+
+do_select_val(X) ->
+ case X of
+ 0 ->
+ zero;
+ 1 bsl 64 ->
+ big;
+ Int when is_integer(Int) ->
+ integer
+ end.