diff options
author | Björn Gustavsson <[email protected]> | 2017-10-02 12:23:35 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-02 12:23:35 +0200 |
commit | 4bb581abb2ef40325ed5303b08ef89a1195134ff (patch) | |
tree | ca6775de515aa42707969d362d660cc22ddcc842 /erts/emulator/test | |
parent | 883ceaec7d5e6c84490de9d766878b1c3877e046 (diff) | |
parent | f589687e9bd172f6f7841043a8de05d260889c8b (diff) | |
download | otp-4bb581abb2ef40325ed5303b08ef89a1195134ff.tar.gz otp-4bb581abb2ef40325ed5303b08ef89a1195134ff.tar.bz2 otp-4bb581abb2ef40325ed5303b08ef89a1195134ff.zip |
Merge branch 'bjorn/erts/improve-beam-ops'
* bjorn/erts/improve-beam-ops:
Move out variables from the head of combined instructions
Change operand from 'P' to 'Q' for i_apply_last and i_apply_fun_last
Add CHECK_ALIGNED() for testing storage destinations
instrs.tab: Add missing -no_next directives
beam_load.c: Generalize the 'P' operator in the packing engine
Break out most of the initialization from process_main()
Eliminate the OpCode() macro
Eliminate unnecessary and inconsistent casts
Refactor macros for accessing Beam instructions
beam_emu: Make order of macros consistent
beam_SUITE: Strengthen test of packed registers
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/beam_SUITE.erl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 6a54fa87e0..bdf8f6c34e 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -113,20 +113,41 @@ packed_registers(Config) when is_list(Config) -> VarName = list_to_atom("M"++integer_to_list(V)), merl:var(VarName) end || V <- Seq], + MoreNewVars = [begin + VarName = list_to_atom("MM"++integer_to_list(V)), + merl:var(VarName) + end || V <- Seq], + TupleEls = [?Q("id(_@Value@)") || {_,Value} <- S0], S = [?Q("_@Var = id(_@Value@)") || {Var,Value} <- S0], Code = ?Q(["-module('@Mod@').\n" "-export([f/0]).\n" "f() ->\n" + "Tuple = id({_@TupleEls}),\n" + "{_@MoreNewVars} = Tuple,\n" "_@S,\n" "_ = id(0),\n" "L = [_@Vars],\n" "_ = id(1),\n" "[_@NewVars] = L,\n" %Test get_list/3. "_ = id(2),\n" - "id([_@Vars,_@NewVars]).\n" + "id([_@Vars,_@NewVars,_@MoreNewVars]).\n" "id(I) -> I.\n"]), merl:compile_and_load(Code), - CombinedSeq = Seq ++ Seq, + + %% Optionally print the generated code. + PrintCode = false, %Change to true to print code. + + case PrintCode of + false -> + ok; + true -> + merl:print(Code), + erts_debug:df(Mod), + {ok,Dis} = file:read_file(atom_to_list(Mod)++".dis"), + io:put_chars(Dis) + end, + + CombinedSeq = Seq ++ Seq ++ Seq, CombinedSeq = Mod:f(), %% Clean up. |