Skip to content

Drop old style type tests #9138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/compiler/src/v3_core.erl
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,6 @@ gexpr_test(E0, Bools0, St0) ->
{icall_eq_true(New),
Eps0 ++ [#iset{anno=Anno,var=New,arg=E1}],Bools0,St2};
#icall{anno=Anno,module=#c_literal{val=erlang},name=#c_literal{val=N},args=As} ->
%% Note that erl_expand_records has renamed type
%% tests to the new names; thus, float/1 as a type
%% test will now be named is_float/1.
Ar = length(As),
case erl_internal:new_type_test(N, Ar) orelse
erl_internal:comp_op(N, Ar) orelse
Expand Down
32 changes: 16 additions & 16 deletions lib/compiler/test/compilation_SUITE_data/compiler_1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,24 @@ system_info(Nodes) ->
?match(Nodes,mnesia:system_info(db_nodes)),
?match(Nodes,mnesia:system_info(running_db_nodes)),
?match(true,mnesia:system_info(have_disc)),
?match(A when atom(A),mnesia:system_info(debug)),
?match(L when list(L),mnesia:system_info(directory)),
?match(L when list(L),mnesia:system_info(log_version)),
?match(A when is_atom(A),mnesia:system_info(debug)),
?match(L when is_list(L),mnesia:system_info(directory)),
?match(L when is_list(L),mnesia:system_info(log_version)),
?match({_,_},mnesia:system_info(schema_version)),
?match(L when list(L),mnesia:system_info(tables)),
?match(L when list(L),mnesia:system_info(local_tables)),
?match(L when list(L),mnesia:system_info(held_locks)),
?match(L when list(L),mnesia:system_info(lock_queue)),
?match(L when list(L),mnesia:system_info(transactions)),
?match(I when integer(I),mnesia:system_info(transaction_failures)),
?match(I when integer(I),mnesia:system_info(transaction_commits)),
?match(I when integer(I),mnesia:system_info(transaction_restarts)),
?match(L when list(L),mnesia:system_info(checkpoints)),
?match(A when atom(A),mnesia:system_info(backup_module)),
?match(L when is_list(L),mnesia:system_info(tables)),
?match(L when is_list(L),mnesia:system_info(local_tables)),
?match(L when is_list(L),mnesia:system_info(held_locks)),
?match(L when is_list(L),mnesia:system_info(lock_queue)),
?match(L when is_list(L),mnesia:system_info(transactions)),
?match(I when is_integer(I),mnesia:system_info(transaction_failures)),
?match(I when is_integer(I),mnesia:system_info(transaction_commits)),
?match(I when is_integer(I),mnesia:system_info(transaction_restarts)),
?match(L when is_list(L),mnesia:system_info(checkpoints)),
?match(A when is_atom(A),mnesia:system_info(backup_module)),
?match(true,mnesia:system_info(auto_repair)),
?match({_,_},mnesia:system_info(dump_log_interval)),
?match(A when atom(A),mnesia:system_info(dump_log_update_in_place)),
?match(I when integer(I),mnesia:system_info(transaction_log_writes)),
?match(A when is_atom(A),mnesia:system_info(dump_log_update_in_place)),
?match(I when is_integer(I),mnesia:system_info(transaction_log_writes)),
?match({'EXIT',{aborted,badarg}},mnesia:system_info(ali_baba)),
done.

Expand All @@ -210,7 +210,7 @@ table_info(Nodes) ->
Keys = lists:seq(1,Size),
Records = [{Tab,A,7} || A <- Keys],
lists:foreach(fun(Rec) -> ?match(ok,mnesia:dirty_write(Rec)) end,Records),
?match(Mem when integer(Mem),mnesia:table_info(Tab,memory)),
?match(Mem when is_integer(Mem),mnesia:table_info(Tab,memory)),
?match(Size,mnesia:table_info(Tab,size)),
?match(Type,mnesia:table_info(Tab,type)),
?match([Node3],mnesia:table_info(Tab,disc_copies)),
Expand Down
30 changes: 15 additions & 15 deletions lib/compiler/test/compilation_SUITE_data/convopts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ convopts(Opts) ->
[case Active of
[{active, true}] ->
[{R, <<?UINT32_MAX:32>>}];
[{active, N}] when integer(N),
[{active, N}] when is_integer(N),
0 =< N, N < ?UINT32_MAX ->
[{R, <<N:32>>}];
[{active, N}] when integer(N),
[{active, N}] when is_integer(N),
-?UINT32_MAX < N, N < 0 ->
[{RR, <<-N:32>>}];
[{active, once}] ->
Expand Down Expand Up @@ -92,17 +92,17 @@ convopts(Opts) ->
case Dest of
%% Port addressed message
[{dest, {tipc_port_id, Port, Proc}}]
when binary(Port),
integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX
when is_binary(Port),
is_integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX
;
list(Port),
integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX ->
is_list(Port),
is_integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX ->
[{$p, [Port | <<Proc:32>>]}];
%% Name addressed message
[{dest, {tipc_name, Type, Inst, Zone}}]
when integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
integer(Zone), 0 =< Zone, Zone =< ?UINT32_MAX ->
when is_integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
is_integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
is_integer(Zone), 0 =< Zone, Zone =< ?UINT32_MAX ->
[{$B, <<Type:32, Inst:32, Zone:32>>}];
%%
%% This undocumented clause uses an undocumented
Expand All @@ -117,13 +117,13 @@ convopts(Opts) ->
[{dest, {tipc_name, Type, Inst,
{tipc_processor_id,
Zone, Subnetwork, Processor}}}]
when integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
integer(Zone),
when is_integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
is_integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
is_integer(Zone),
0 =< Zone, Zone < 16#FF,
integer(Subnetwork),
is_integer(Subnetwork),
0 =< Subnetwork, Subnetwork < 16#FFF,
integer(Processor),
is_integer(Processor),
0 =< Processor, Processor < 16#FFF ->
[{$B, <<Type:32,
Inst:32,
Expand All @@ -140,7 +140,7 @@ convopts(Opts) ->



getopts(List, Options) when list(List), list(Options) ->
getopts(List, Options) when is_list(List), is_list(Options) ->
getopts_1(Options, List, []).

getopts_1([], List, Result) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/test/compilation_SUITE_data/otp_5235.erl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ run(0, L) -> L;
run(N, L) -> run(N-1, reverse(L)).

reverse([]) -> [];
reverse([H|R]) when record(H, commit) ->
reverse([H|R]) when is_record(H, commit) ->
[H#commit{
ram_copies = lists:reverse(H#commit.ram_copies),
disc_copies = lists:reverse(H#commit.disc_copies),
Expand Down
Loading
Loading