aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/code_SUITE.erl28
-rw-r--r--lib/kernel/test/code_SUITE_data/upgrade_client.erl28
2 files changed, 36 insertions, 20 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 96f8ff2c5f..29b3f7caaf 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -487,12 +487,21 @@ load_binary(Config) when is_list(Config) ->
upgrade(Config) ->
DataDir = proplists:get_value(data_dir, Config),
- T = case erlang:system_info(hipe_architecture) of
- undefined -> [beam];
- _ -> [beam,hipe]
- end,
-
- [upgrade_do(DataDir, Client, T) || Client <- T],
+ case erlang:system_info(hipe_architecture) of
+ undefined ->
+ upgrade_do(DataDir, beam, [beam]);
+
+ _ ->
+ T = [beam, hipe],
+ [upgrade_do(DataDir, Client, T) || Client <- T],
+
+ case hipe:llvm_support_available() of
+ false -> ok;
+ true ->
+ T2 = [beam, hipe_llvm],
+ [upgrade_do(DataDir, Client, T2) || Client <- T2]
+ end
+ end,
ok.
upgrade_do(DataDir, Client, T) ->
@@ -502,7 +511,7 @@ upgrade_do(DataDir, Client, T) ->
ok.
compile_load(Mod, Dir, Ver, CodeType) ->
- erlang:display({"{{{{{{{{{{{{{{{{Loading",Mod,Ver,CodeType}),
+ %%erlang:display({"{{{{{{{{{{{{{{{{Loading",Mod,Ver,CodeType}),
Version = case Ver of
undefined ->
io:format("Compiling '~p' as ~p\n", [Mod, CodeType]),
@@ -514,7 +523,8 @@ compile_load(Mod, Dir, Ver, CodeType) ->
end,
Target = case CodeType of
beam -> [];
- hipe -> [native]
+ hipe -> [native];
+ hipe_llvm -> [native,{hipe,[to_llvm]}]
end,
CompOpts = [binary, report] ++ Target ++ Version,
@@ -527,7 +537,7 @@ compile_load(Mod, Dir, Ver, CodeType) ->
T3 = erlang:now(),
io:format("Compile time ~p ms, Load time ~p ms\n",
[timer:now_diff(T2,T1) div 1000, timer:now_diff(T3,T2) div 1000]),
- erlang:display({"}}}}}}}}}}}}}}}Loaded",Mod,Ver,CodeType}),
+ %%erlang:display({"}}}}}}}}}}}}}}}Loaded",Mod,Ver,CodeType}),
ok.
dir_req(Config) when is_list(Config) ->
diff --git a/lib/kernel/test/code_SUITE_data/upgrade_client.erl b/lib/kernel/test/code_SUITE_data/upgrade_client.erl
index 98d36f6014..faa18e1410 100644
--- a/lib/kernel/test/code_SUITE_data/upgrade_client.erl
+++ b/lib/kernel/test/code_SUITE_data/upgrade_client.erl
@@ -65,7 +65,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
put(exp1exp2_fun, upgradee:get_exp1exp2_fun()),
?line 1 = (get(exp1exp2_fun))(),
- ?line 13 = check_tracing(Tracer),
+ ok = check_tracing(Tracer, 13),
%%
%% Load version 1 of other
@@ -89,7 +89,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
?line {'EXIT',{undef,_}} = proxy_call(P, other, exp2),
?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
- ?line 5 = check_tracing(Tracer),
+ ok = check_tracing(Tracer, 5),
%%
%% Load version 2 of upgradee
@@ -150,7 +150,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
?line 2 = (get(exp1exp2_fun))(),
- ?line 10 = check_tracing(Tracer),
+ ok = check_tracing(Tracer, 10),
%%
%% Load version 2 of other
@@ -208,7 +208,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
?line {2,Env2} = (get(loc2_fun))(),
?line 2 = (get(exp1exp2_fun))(),
- ?line 10 = check_tracing(Tracer),
+ ok = check_tracing(Tracer, 10),
%%
%% Upgrade proxy to version 2
@@ -273,7 +273,7 @@ run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
?line {'EXIT',{undef,_}} = (catch (get(exp1exp2_fun))()),
- ?line 14 = check_tracing(Tracer),
+ ok = check_tracing(Tracer, 14),
unlink(P),
exit(P, die_please),
@@ -319,18 +319,24 @@ tracer_loop(Receiver) ->
tracer_loop(Receiver)
end.
-check_tracing(Tracer) ->
+check_tracing(Tracer, Expected) ->
Tracer ! {do_trace_delivered, self()},
- check_tracing_loop(0).
+ case check_tracing_loop(0,[]) of
+ {Expected,_} ->
+ ok;
+ {Got, MsgList} ->
+ io:format("Expected ~p trace msg, got ~p:\n~p\n",
+ [Expected, Got, lists:reverse(MsgList)]),
+ "Trace msg mismatch"
+ end.
-check_tracing_loop(N) ->
+check_tracing_loop(N, MsgList) ->
Self = self(),
receive
{trace, _Pid, call, {_M, _F, _Args}} = Msg ->
- io:format("Trace: ~p\n",[Msg]),
- check_tracing_loop(N+1);
+ check_tracing_loop(N+1, [Msg | MsgList]);
{trace_delivered, Self, _} ->
- N
+ {N, MsgList}
end.