aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-11-02 14:39:15 +0100
committerSverker Eriksson <[email protected]>2016-11-02 14:39:15 +0100
commit38e1f98a0a4729357c3669a5c5e2f93ad5ab1d90 (patch)
tree4acc9c4347b18577cdfbb4721d10a636846a79b9 /erts/emulator/test
parent2ccd860e57929c12752d55226d4c4084bccc5b2d (diff)
parent24485c421f15b00d0b5c97633d701373b53897a5 (diff)
downloadotp-38e1f98a0a4729357c3669a5c5e2f93ad5ab1d90.tar.gz
otp-38e1f98a0a4729357c3669a5c5e2f93ad5ab1d90.tar.bz2
otp-38e1f98a0a4729357c3669a5c5e2f93ad5ab1d90.zip
Merge branch 'sverker/hipe-load_nif-error/OTP-14002'
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/nif_SUITE.erl18
-rw-r--r--erts/emulator/test/nif_SUITE_data/hipe_compiled.erl6
2 files changed, 24 insertions, 0 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index 306f2091a1..3a76ee6aee 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -30,6 +30,7 @@
init_per_testcase/2, end_per_testcase/2,
basic/1, reload_error/1, upgrade/1, heap_frag/1,
t_on_load/1,
+ hipe/1,
types/1, many_args/1, binaries/1, get_string/1, get_atom/1,
maps/1,
api_macros/1,
@@ -70,6 +71,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[basic, reload_error, upgrade, heap_frag, types, many_args,
t_on_load,
+ hipe,
binaries, get_string, get_atom, maps, api_macros, from_array,
iolist_as_binary, resource, resource_binary,
resource_takeover, threading, send, send2, send3,
@@ -88,6 +90,11 @@ all() ->
init_per_testcase(t_on_load, Config) ->
ets:new(nif_SUITE, [named_table]),
Config;
+init_per_testcase(hipe, Config) ->
+ case erlang:system_info(hipe_architecture) of
+ undefined -> {skip, "HiPE is disabled"};
+ _ -> Config
+ end;
init_per_testcase(_Case, Config) ->
Config.
@@ -411,6 +418,17 @@ t_on_load(Config) when is_list(Config) ->
verify_tmpmem(TmpMem),
ok.
+hipe(Config) when is_list(Config) ->
+ Data = proplists:get_value(data_dir, Config),
+ Priv = proplists:get_value(priv_dir, Config),
+ Src = filename:join(Data, "hipe_compiled"),
+ {ok,hipe_compiled} = c:c(Src, [{outdir,Priv},native]),
+ true = code:is_module_native(hipe_compiled),
+ {error, {notsup,_}} = hipe_compiled:try_load_nif(),
+ true = code:delete(hipe_compiled),
+ false = code:purge(hipe_compiled),
+ ok.
+
%% Test NIF building heap fragments
heap_frag(Config) when is_list(Config) ->
diff --git a/erts/emulator/test/nif_SUITE_data/hipe_compiled.erl b/erts/emulator/test/nif_SUITE_data/hipe_compiled.erl
new file mode 100644
index 0000000000..84ddbc8d63
--- /dev/null
+++ b/erts/emulator/test/nif_SUITE_data/hipe_compiled.erl
@@ -0,0 +1,6 @@
+-module(hipe_compiled).
+
+-export([try_load_nif/0]).
+
+try_load_nif() ->
+ erlang:load_nif("doesn't matter", 0).