summaryrefslogtreecommitdiff
path: root/lib/compiler/test/test_lib.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2019-09-19 14:20:30 +0200
committerGitHub <noreply@github.com>2019-09-19 14:20:30 +0200
commitaeb981bcf48be40027e5332831026dd440daf348 (patch)
treec10e6501988ae92093ab8174b38c4b02dde37966 /lib/compiler/test/test_lib.erl
parent43d8e4299d49141bab2d1145de64c3593252b073 (diff)
parent148567a6b9258ae74138566c9109d348b1768583 (diff)
downloaderlang-aeb981bcf48be40027e5332831026dd440daf348.tar.gz
Merge pull request #2387 from bjorng/bjorn/compiler/bool-opt
Move guard optimizations from v3_kernel to a new beam_ssa_bool pass
Diffstat (limited to 'lib/compiler/test/test_lib.erl')
-rw-r--r--lib/compiler/test/test_lib.erl18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index 4b68e663cd..66f45aad5e 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -21,7 +21,8 @@
-include_lib("common_test/include/ct.hrl").
-compile({no_auto_import,[binary_part/2]}).
--export([id/1,recompile/1,parallel/0,uniq/0,opt_opts/1,get_data_dir/1,
+-export([id/1,recompile/1,recompile_core/1,parallel/0,
+ uniq/0,opt_opts/1,get_data_dir/1,
is_cloned_mod/1,smoke_disasm/1,p_run/2,
highest_opcode/1]).
@@ -45,6 +46,21 @@ recompile(Mod) when is_atom(Mod) ->
%% Smoke-test of beam disassembler.
smoke_disasm(Mod).
+recompile_core(Mod) when is_atom(Mod) ->
+ case whereis(cover_server) of
+ undefined -> ok;
+ _ ->
+ %% Re-compile the test suite if the cover server is running.
+ Beam = code:which(Mod),
+ Src = filename:rootname(Beam, ".beam"),
+ Opts = [bin_opt_info|opt_opts(Mod)],
+ io:format("Recompiling ~p (~p)\n", [Mod,Opts]),
+ c:c(Src, [from_core,{outdir,filename:dirname(Src)}|Opts])
+ end,
+
+ %% Smoke-test of beam disassembler.
+ smoke_disasm(Mod).
+
smoke_disasm(Mod) when is_atom(Mod) ->
smoke_disasm(code:which(Mod));
smoke_disasm(File) when is_list(File) ->