Permalink
Browse files

Merge branch 'bg/temp-hipe-fixes' into pu

Conflicts:
	lib/compiler/test/compilation_SUITE.erl
  • Loading branch information...
proxyles committed Oct 11, 2012
2 parents e85c4dd + 497eae8 commit 328271fc16c1be3cf11205100b044d033e995246
@@ -1247,9 +1247,16 @@ beam_asm(#compile{ifile=File,code=Code0,
(Other) -> Other
end, Opts0),
Opts2 = [O || O <- Opts1, effects_code_generation(O)],
- case beam_asm:module(Code0, Abst, Source, Opts2) of
- {ok,Code} -> {ok,St#compile{code=Code,abstract_code=[]}}
- end.
+
+ %% Turn off native code generation if on_load is used.
+ {_Mod,_Exp,Attr,_Asm,_NumLabels} = Code0,
+ NewOpts = case proplists:get_value(on_load, Attr) of
+ undefined -> Opts0;
+ [{_,_}] -> Opts0 -- [native]
+ end,
+
+ {ok,Code} = beam_asm:module(Code0, Abst, Source, Opts2),
+ {ok,St#compile{code=Code,abstract_code=[],options=NewOpts}}.
test_native(#compile{options=Opts}) ->
%% This test is done late, in case some other option has turned off native.
@@ -18,6 +18,7 @@
%%
-module(andor_SUITE).
+-compile(no_native).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1,
@@ -158,9 +158,16 @@ split({int, N}, <<N:16,B:N/binary,T/binary>>) ->
?comp(otp_6121b).
?comp(convopts).
?comp(otp_7202).
-?comp(on_load).
?comp(on_load_inline).
+on_load(Config) when is_list(Config) ->
+ case test_server:is_native(?MODULE) of
+ false ->
+ try_it(on_load, Config);
+ true ->
+ {skip,"Native code causes crash"}
+ end.
+
beam_compiler_7(doc) ->
"Code snippet submitted from Ulf Wiger which fails in R3 Beam.";
beam_compiler_7(suite) -> [];
@@ -412,7 +419,11 @@ self_compile(Config) when is_list(Config) ->
self_compile_old_inliner(Config) when is_list(Config) ->
%% The old inliner is useful for testing that sys_core_fold does not
%% introduce name capture problems.
- self_compile_1(Config, "old", [verbose,{inline,500}]).
+ HowMuch = case test_server:is_native(?MODULE) of
+ true -> 100;
+ false -> 500
+ end,
+ self_compile_1(Config, "old", [verbose,{inline,HowMuch}]).
self_compile_1(Config, Prefix, Opts) ->
?line Dog = test_server:timetrap(test_server:minutes(40)),
@@ -34,6 +34,8 @@
%-define(line_trace, 1).
-include_lib("test_server/include/test_server.hrl").
+-compile(no_native).
+
-define(default_timeout, ?t:minutes(1)).
suite() -> [{ct_hooks,[ts_install_cth]}].

0 comments on commit 328271f

Please sign in to comment.