From 856e0abc93b1234ccb8cb48383b4fc07a0624b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 26 Apr 2016 12:47:43 +0200 Subject: compilation_SUITE: Run the Core linter for all compilations --- lib/compiler/test/compilation_SUITE.erl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 6961e625fd..fdb264469a 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -245,8 +245,8 @@ try_it(StartNode, Module, Timetrap, Conf) -> atom_to_list(Module)), Out = proplists:get_value(priv_dir,Conf), io:format("Compiling: ~s\n", [Src]), - CompRc0 = compile:file(Src, [clint,{outdir,Out},report, - bin_opt_info|OtherOpts]), + CompRc0 = compile:file(Src, [clint0,clint,{outdir,Out},report, + bin_opt_info|OtherOpts]), io:format("Result: ~p\n",[CompRc0]), {ok,_Mod} = CompRc0, @@ -265,7 +265,8 @@ try_it(StartNode, Module, Timetrap, Conf) -> ct:timetrap(Timetrap), io:format("Compiling (without optimization): ~s\n", [Src]), CompRc1 = compile:file(Src, - [no_copt,no_postopt,{outdir,Out},report|OtherOpts]), + [no_copt,no_postopt, + {outdir,Out},report|OtherOpts]), io:format("Result: ~p\n",[CompRc1]), {ok,_Mod} = CompRc1, @@ -273,8 +274,9 @@ try_it(StartNode, Module, Timetrap, Conf) -> ct:timetrap(Timetrap), io:format("Compiling (with old inliner): ~s\n", [Src]), - CompRc2 = compile:file(Src, [{outdir,Out},report,bin_opt_info, - {inline,1000}|OtherOpts]), + CompRc2 = compile:file(Src, [clint, + {outdir,Out},report,bin_opt_info, + {inline,1000}|OtherOpts]), io:format("Result: ~p\n",[CompRc2]), {ok,_Mod} = CompRc2, ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]), @@ -465,6 +467,7 @@ compile_compiler(Files, OutDir, Version, InlineOpts) -> io:format("~ts", [code:which(compile)]), io:format("Compiling ~s into ~ts", [Version,OutDir]), Opts = [report, + clint0,clint, bin_opt_info, {outdir,OutDir}, {d,'COMPILER_VSN',"\""++Version++"\""}, -- cgit v1.2.3 From c8385ccb0e9f57fcd6c2cf0c3a16b1eb4e2a2b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 21 Apr 2016 12:07:20 +0200 Subject: Remove useless test case compilation_SUITE:otp_2141/1 --- lib/compiler/test/compilation_SUITE.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index fdb264469a..1f64da96ff 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -43,7 +43,7 @@ groups() -> beam_compiler_8,beam_compiler_9,beam_compiler_10, beam_compiler_11,beam_compiler_12, nested_tuples_in_case_expr,otp_2330,guards, - {group,vsn},otp_2380,otp_2141,otp_2173,otp_4790, + {group,vsn},otp_2380,otp_2173,otp_4790, const_list_256,bin_syntax_1,bin_syntax_2, bin_syntax_3,bin_syntax_4,bin_syntax_5,bin_syntax_6, live_var,convopts, @@ -95,7 +95,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_2330). ?comp(otp_2380). -?comp(otp_2141). ?comp(otp_2173). ?comp(otp_4790). ?comp(otp_5235). -- cgit v1.2.3 From b3cc530f47a38dd65d4dfeb3610fe34eb833fb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 21 Apr 2016 06:40:54 +0200 Subject: Move bit syntax test cases from compilation_SUITE to bs_match_SUITE We used to put code that would crash the compiler into compilation_SUITE_data. That way we would have a failing test case to remind us to fix a bug. Nowadays, we generally fix the bug and write the test case at the same time. Therefore it makes more sense to put the test code directly into a test suite. Move out bin_syntax_1 through bin_syntax_5 test cases. Scrap bin_syntax_6 because it does not longer seems to be relevant. While we are it, rename the fun_shadow/1 test to size_shadow/1. Also make sure that the code produces the correct result. --- lib/compiler/test/compilation_SUITE.erl | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 1f64da96ff..6a29016337 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -44,9 +44,7 @@ groups() -> beam_compiler_11,beam_compiler_12, nested_tuples_in_case_expr,otp_2330,guards, {group,vsn},otp_2380,otp_2173,otp_4790, - const_list_256,bin_syntax_1,bin_syntax_2, - bin_syntax_3,bin_syntax_4,bin_syntax_5,bin_syntax_6, - live_var,convopts, + const_list_256,live_var,convopts, catch_in_catch,redundant_case,long_string,otp_5076, complex_guard,otp_5092,otp_5151,otp_5235,otp_5244, trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, @@ -107,13 +105,6 @@ end_per_group(_GroupName, Config) -> ?comp(const_list_256). -?comp(bin_syntax_1). -?comp(bin_syntax_2). -?comp(bin_syntax_3). -?comp(bin_syntax_4). - -?comp(bin_syntax_6). - ?comp(otp_5076). ?comp(complex_guard). @@ -121,27 +112,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_5092). ?comp(otp_5151). -%%% By Per Gustafsson - -bin_syntax_5(Config) when is_list(Config) -> - {<<45>>,<<>>} = split({int, 1}, <<1:16,45>>). - -split({int, N}, <>) -> - {B,T}. - -%% This program works with the old version of the compiler -%% but, the core erlang that it produces have the same variable appearing -%% looks like this: -%% -%% split({int, N}, <<_core1:16, B:N/binary, T/binary>>) when _core1==N -%% -%% with my change it will look like this: -%% -%% split({int, N}, <<_core1:16, B:_core1/binary, T/binary>>) when _core1==N -%% -%% This means that everything worked fine as long as the pattern -%% matching order was left-to-right but on core erlang any order should be possible - ?comp(live_var). ?comp(trycatch_4). -- cgit v1.2.3 From 9ede36883bfcfdd9da53b7410c690d59da5384c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 21 Apr 2016 13:19:48 +0200 Subject: Move tests from compilation_SUITE to record_SUITE --- lib/compiler/test/compilation_SUITE.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 6a29016337..499b7f172f 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -37,13 +37,12 @@ groups() -> [{vsn,[parallel],[vsn_1,vsn_2,vsn_3]}, {p,test_lib:parallel(), [compiler_1, - compiler_3,compiler_5,beam_compiler_1, - beam_compiler_2,beam_compiler_3,beam_compiler_4, + beam_compiler_3,beam_compiler_4, beam_compiler_5,beam_compiler_6,beam_compiler_7, beam_compiler_8,beam_compiler_9,beam_compiler_10, beam_compiler_11,beam_compiler_12, nested_tuples_in_case_expr,otp_2330,guards, - {group,vsn},otp_2380,otp_2173,otp_4790, + {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, catch_in_catch,redundant_case,long_string,otp_5076, complex_guard,otp_5092,otp_5151,otp_5235,otp_5244, @@ -72,12 +71,8 @@ end_per_group(_GroupName, Config) -> N(Config) when is_list(Config) -> failure(N, Config)). ?comp(compiler_1). -?comp(compiler_3). ?comp(compiler_4). -?comp(compiler_5). -?comp(beam_compiler_1). -?comp(beam_compiler_2). ?comp(beam_compiler_3). ?comp(beam_compiler_4). ?comp(beam_compiler_5). @@ -93,7 +88,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_2330). ?comp(otp_2380). -?comp(otp_2173). ?comp(otp_4790). ?comp(otp_5235). -- cgit v1.2.3 From 1c522768f679916791e0fd6c71adb835783c1694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 25 Apr 2016 09:10:43 +0200 Subject: Remove compilation_SUITE:guards/1 Obsoleted by guard_SUITE (especially literal_type_tests/1). --- lib/compiler/test/compilation_SUITE.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 499b7f172f..a9dc14f78d 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -41,7 +41,7 @@ groups() -> beam_compiler_5,beam_compiler_6,beam_compiler_7, beam_compiler_8,beam_compiler_9,beam_compiler_10, beam_compiler_11,beam_compiler_12, - nested_tuples_in_case_expr,otp_2330,guards, + nested_tuples_in_case_expr,otp_2330, {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, catch_in_catch,redundant_case,long_string,otp_5076, @@ -93,8 +93,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_5244). -?comp(guards). - ?comp(pattern_expr). ?comp(const_list_256). -- cgit v1.2.3 From 2aabd0f9ca9ab7d9d59c1504b9742734e2d6c945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 25 Apr 2016 12:06:38 +0200 Subject: Move complex_guard/1 from compilation_SUITE to guard_SUITE --- lib/compiler/test/compilation_SUITE.erl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index a9dc14f78d..fde266e5b0 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -45,7 +45,7 @@ groups() -> {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, catch_in_catch,redundant_case,long_string,otp_5076, - complex_guard,otp_5092,otp_5151,otp_5235,otp_5244, + otp_5092,otp_5151,otp_5235,otp_5244, trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, otp_6121a,otp_6121b,otp_7202,otp_7345,on_load, @@ -98,9 +98,6 @@ end_per_group(_GroupName, Config) -> ?comp(const_list_256). ?comp(otp_5076). - -?comp(complex_guard). - ?comp(otp_5092). ?comp(otp_5151). -- cgit v1.2.3 From 9fddd89e347590aba3594829f904ea5211805958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 25 Apr 2016 12:40:35 +0200 Subject: Move test cases from compilation_SUITE to beam_utils_SUITE beam_utils_SUITE didn't exist when the two test cases were written. --- lib/compiler/test/compilation_SUITE.erl | 37 +-------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index fde266e5b0..39174f64d1 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -49,8 +49,7 @@ groups() -> trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, otp_6121a,otp_6121b,otp_7202,otp_7345,on_load, - string_table,otp_8949_a,otp_8949_b,split_cases, - beam_utils_liveopt]}]. + string_table,otp_8949_a,split_cases]}]. init_per_suite(Config) -> Config. @@ -601,24 +600,6 @@ do_otp_8949_a() -> end end. -otp_8949_b(Config) when is_list(Config) -> - self() ! something, - value = otp_8949_b([], false), - {'EXIT',_} = (catch otp_8949_b([], true)), - ok. - -%% Would cause an endless loop in beam_utils. -otp_8949_b(A, B) -> - Var = id(value), - if - A == [], B == false -> - ok - end, - receive - something -> - id(Var) - end. - split_cases(_) -> dummy1 = do_split_cases(x), {'EXIT',{{badmatch,b},_}} = (catch do_split_cases(y)), @@ -634,21 +615,5 @@ do_split_cases(A) -> end, Z. --record(alarmInfo, {type,cause,origin}). - -beam_utils_liveopt(Config) -> - F = beam_utils_liveopt_fun(42, pebkac, user), - void = F(42, #alarmInfo{type=sctp,cause=pebkac,origin=user}), - ok. - -beam_utils_liveopt_fun(Peer, Cause, Origin) -> - fun(PeerNo, AlarmInfo) - when PeerNo == Peer andalso - AlarmInfo == #alarmInfo{type=sctp, - cause=Cause, - origin=Origin} -> - void - end. - id(I) -> I. -- cgit v1.2.3 From ac25ce01652888cd9b2e1f88ef68933a7cb87d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 26 Apr 2016 09:29:14 +0200 Subject: Move pattern-matching tests to match_SUITE --- lib/compiler/test/compilation_SUITE.erl | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 39174f64d1..2d62c09883 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -37,15 +37,14 @@ groups() -> [{vsn,[parallel],[vsn_1,vsn_2,vsn_3]}, {p,test_lib:parallel(), [compiler_1, - beam_compiler_3,beam_compiler_4, - beam_compiler_5,beam_compiler_6,beam_compiler_7, + beam_compiler_4,beam_compiler_6,beam_compiler_7, beam_compiler_8,beam_compiler_9,beam_compiler_10, - beam_compiler_11,beam_compiler_12, - nested_tuples_in_case_expr,otp_2330, + beam_compiler_11, + otp_2330, {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, catch_in_catch,redundant_case,long_string,otp_5076, - otp_5092,otp_5151,otp_5235,otp_5244, + otp_5092,otp_5151,otp_5235, trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, otp_6121a,otp_6121b,otp_7202,otp_7345,on_load, @@ -72,28 +71,19 @@ end_per_group(_GroupName, Config) -> ?comp(compiler_1). ?comp(compiler_4). -?comp(beam_compiler_3). ?comp(beam_compiler_4). -?comp(beam_compiler_5). ?comp(beam_compiler_6). ?comp(beam_compiler_8). ?comp(beam_compiler_9). ?comp(beam_compiler_10). ?comp(beam_compiler_11). -?comp(beam_compiler_12). ?comp(beam_compiler_13). -?comp(nested_tuples_in_case_expr). - ?comp(otp_2330). ?comp(otp_2380). ?comp(otp_4790). ?comp(otp_5235). -?comp(otp_5244). - -?comp(pattern_expr). - ?comp(const_list_256). ?comp(otp_5076). -- cgit v1.2.3 From 723017eaddf053bd5868be54a60b8031142384b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 07:39:17 +0200 Subject: Remove compilation_SUITE:long_string/1 long_string/1 was written to test that long string were handled efficiently in beam_asm. Strings used to be stored in the string table chunk, but are currently literals. There does not seem that this test case is likely to find any bugs. --- lib/compiler/test/compilation_SUITE.erl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 2d62c09883..0d43a89d68 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -43,7 +43,7 @@ groups() -> otp_2330, {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, - catch_in_catch,redundant_case,long_string,otp_5076, + catch_in_catch,redundant_case,otp_5076, otp_5092,otp_5151,otp_5235, trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, @@ -346,11 +346,6 @@ get_vsn(M) -> {vsn,V} = lists:keyfind(vsn, 1, M:module_info(attributes)), V. -long_string(Config) when is_list(Config) -> - %% The test must complete in one minute - it should be plenty of time. - try_it(false, long_string, {minutes,1}, Config), - ok. - compile_load(Module, Dir, Conf) -> Src = filename:join(Dir, atom_to_list(Module)), Out = proplists:get_value(priv_dir,Conf), -- cgit v1.2.3 From a6b9fcfb146481657a980c96bf4bfe6c25f0f7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 11:59:15 +0200 Subject: Move catch tests to trycatch_SUITE --- lib/compiler/test/compilation_SUITE.erl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 0d43a89d68..786b82c06b 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -43,11 +43,11 @@ groups() -> otp_2330, {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, - catch_in_catch,redundant_case,otp_5076, + redundant_case,otp_5076, otp_5092,otp_5151,otp_5235, - trycatch_4,opt_crash,otp_5404,otp_5436,otp_5481, + opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, - otp_6121a,otp_6121b,otp_7202,otp_7345,on_load, + otp_7202,otp_7345,on_load, string_table,otp_8949_a,split_cases]}]. init_per_suite(Config) -> @@ -91,11 +91,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_5151). ?comp(live_var). - -?comp(trycatch_4). - -?comp(catch_in_catch). - ?comp(opt_crash). ?comp(otp_5404). @@ -106,8 +101,6 @@ end_per_group(_GroupName, Config) -> ?comp(otp_5714). ?comp(otp_5872). ?comp(otp_6121). -?comp(otp_6121a). -?comp(otp_6121b). ?comp(convopts). ?comp(otp_7202). ?comp(on_load). -- cgit v1.2.3 From 1dae2af0186107dff01916323a5a58ce83db22ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 11:59:15 +0200 Subject: Move list comprehension tests to lc_SUITE --- lib/compiler/test/compilation_SUITE.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 786b82c06b..c58807b0bb 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -43,8 +43,8 @@ groups() -> otp_2330, {group,vsn},otp_2380,otp_4790, const_list_256,live_var,convopts, - redundant_case,otp_5076, - otp_5092,otp_5151,otp_5235, + redundant_case, + otp_5151,otp_5235, opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, otp_7202,otp_7345,on_load, @@ -86,8 +86,6 @@ end_per_group(_GroupName, Config) -> ?comp(const_list_256). -?comp(otp_5076). -?comp(otp_5092). ?comp(otp_5151). ?comp(live_var). -- cgit v1.2.3 From 2b48cb1b253aa090e655508a8e813f913cf32181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 13:15:19 +0200 Subject: Move code from compilation_SUITE to beam_block_SUITE --- lib/compiler/test/compilation_SUITE.erl | 108 +------------------------------- 1 file changed, 1 insertion(+), 107 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index c58807b0bb..62d2e1eecc 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -47,7 +47,7 @@ groups() -> otp_5151,otp_5235, opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, - otp_7202,otp_7345,on_load, + otp_7202,on_load, string_table,otp_8949_a,split_cases]}]. init_per_suite(Config) -> @@ -438,112 +438,6 @@ compare_compilers(ADir, BDir) -> ["beam_asm.beam"] = [filename:basename(A) || {A,_} <- D], ok. -%%% -%%% The only test of the following code is that it compiles. -%%% - -%% Slightly simplifed from megaco_binary_term_id_gen. -%% beam_block failed to note that the {gc_bif,'-'...} instruction could -%% fail, and that therefore {y,0} need to be initialized. -%% {allocate,8,6}. -%% %% {init,{y,0}} needed here. -%% {get_list,{x,1},{x,6},{x,7}}. -%% {'catch',{y,7},{f,3}}. -%% {move,{x,4},{y,1}}. -%% {move,{x,3},{y,2}}. -%% {move,{x,2},{y,3}}. -%% {move,{x,5},{y,4}}. -%% {move,{x,7},{y,5}}. -%% {move,{x,6},{y,6}}. -%% {gc_bif,'-',{f,0},8,[{x,3},{x,6}],{x,0}}. -%% {move,{x,0},{y,0}}. - -encode_wildcards3([],[],_,_) -> []; -encode_wildcards3([Level|Levels],[BitsInLevel|BitsRest],LevelNo,TotSize) -> - case (catch ?MODULE:encode_wildcard(Level,BitsInLevel,TotSize-BitsInLevel, - length(Levels))) of - {'EXIT',{Reason,Info}} -> - exit({Reason,{LevelNo,Info}}); - - no_wildcard -> - encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel); - - {level,Wl} -> - [Wl| - encode_wildcards3(Levels,BitsRest,LevelNo+1,TotSize-BitsInLevel)]; - - {recursive,Wr} -> - [Wr] - end. - -%% Slightly simplified code from hipe_rtl_ssapre. -%% beam_block used to do the following incorrect optimization: -%% -%% {gc_bif,length,{f,0},1,[{x,0}],{x,3}}. -%% ^^^^^ Was {x,0} - changing to {x,3} is not safe. -%% {gc_bif,'+',{f,0},0,[{y,2},{integer,1}],{x,0}}. -%% ^^^ Only one register live -%% . . . -%% {call_last,4,{f,2},4}. %% beam_validator noted that {x,3} wasn't live. - -find_operands(Cfg,XsiGraph,[],_Count) -> - {Cfg,XsiGraph}; -find_operands(Cfg,XsiGraph,ActiveList,Count) -> - {NewCfg,TempActiveList}=?MODULE:find_operands_for_active_list(Cfg,XsiGraph, - ActiveList,[]), - NewActiveList=lists:reverse(TempActiveList), - [Count+1, length(NewActiveList), length(digraph:vertices(XsiGraph))], - find_operands(NewCfg,XsiGraph,NewActiveList,Count+1). - - -%% The following code -%% -%% {get_list,{x,2},{x,0},{x,1}}. -%% {gc_bif,length,{f,0},1,[{x,0}],{x,0}}. -%% {move,{x,0},{x,1}}. -%% -%% was incorrectly optimized to -%% -%% {get_list,{x,2},{x,0},{y,0}}. -%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}}. -%% -%% because beam_block:is_transparent({x,1}, -%% {gc_bif,length,{f,0},3,[{x,0}],{x,1}} -%% incorrectly returned true. - --record(contextId,{cid,device_type,contextRef}). --record(dpRef,{cid,tlli,ms_device_context_id}). --record(qosProfileBssgp,{peak_bit_rate_msb, - peak_bit_rate_lsb, - t_a_precedence}). --record(llUnitdataReq,{sapi, - l3_pdu_length, - pdu_life}). --record(ptmsi,{value}). - -otp_7345(Config) when is_list(Config) -> - #llUnitdataReq{l3_pdu_length=3,pdu_life=4} = - otp_7345(#contextId{}, 0, [[1,2,3],4,5]). - - -otp_7345(ObjRef, _RdEnv, Args) -> - Cid = ObjRef#contextId.cid, - _ = #dpRef{cid = Cid, - ms_device_context_id = cid_id, - tlli = #ptmsi{value = 0}}, - _ = #qosProfileBssgp{peak_bit_rate_msb = 0, - peak_bit_rate_lsb = 80, - t_a_precedence = 49}, - [Cpdu|_] = Args, - LlUnitdataReq = - #llUnitdataReq{sapi = 7, - l3_pdu_length = length(Cpdu), - pdu_life = - id(42) - div - 10}, - id(LlUnitdataReq). - %% Check the generation of the string table. string_table(Config) when is_list(Config) -> -- cgit v1.2.3 From 929bd552e501ae6b1fe4fc30d093f0949c34bd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 13:35:58 +0200 Subject: Remove support for running tests on a separate Erlang node It has not been used for ages. --- lib/compiler/test/compilation_SUITE.erl | 36 ++++----------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 62d2e1eecc..9079e14e02 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -171,13 +171,7 @@ check_error_1(Str0) -> -define(TC(Body), tc(fun() -> Body end, ?LINE)). try_it(Module, Conf) -> - %% Change 'false' to 'true' to start a new node for every module. - try_it(false, Module, Conf). - -try_it(StartNode, Module, Conf) -> - try_it(StartNode, Module, {minutes,10}, Conf). - -try_it(StartNode, Module, Timetrap, Conf) -> + Timetrap = {minutes,10}, OtherOpts = [], %Can be changed to [time] if needed Src = filename:join(proplists:get_value(data_dir, Conf), atom_to_list(Module)), @@ -188,16 +182,6 @@ try_it(StartNode, Module, Timetrap, Conf) -> io:format("Result: ~p\n",[CompRc0]), {ok,_Mod} = CompRc0, - Node = case StartNode of - false -> - node(); - true -> - Pa = "-pa " ++ filename:dirname(code:which(?MODULE)), - {ok,Node0} = start_node(compiler, Pa), - Node0 - end, - - ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]), load_and_call(Out, Module), ct:timetrap(Timetrap), @@ -208,7 +192,7 @@ try_it(StartNode, Module, Timetrap, Conf) -> io:format("Result: ~p\n",[CompRc1]), {ok,_Mod} = CompRc1, - ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]), + load_and_call(Out, Module), ct:timetrap(Timetrap), io:format("Compiling (with old inliner): ~s\n", [Src]), @@ -217,7 +201,7 @@ try_it(StartNode, Module, Timetrap, Conf) -> {inline,1000}|OtherOpts]), io:format("Result: ~p\n",[CompRc2]), {ok,_Mod} = CompRc2, - ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]), + load_and_call(Out, Module), ct:timetrap(Timetrap), io:format("Compiling (from assembly): ~s\n", [Src]), @@ -226,12 +210,8 @@ try_it(StartNode, Module, Timetrap, Conf) -> CompRc3 = compile:file(Asm, [from_asm,{outdir,Out},report|OtherOpts]), io:format("Result: ~p\n",[CompRc3]), {ok,_} = CompRc3, - ok = rpc:call(Node, ?MODULE, load_and_call, [Out, Module]), + load_and_call(Out, Module), - case StartNode of - false -> ok; - true -> test_server:stop_node(Node) - end, ok. load_and_call(Out, Module) -> @@ -264,14 +244,6 @@ tc(F, Line) -> io:format("~p: ~p\n", [Line,Diff]), Value. -start_node(Name, Args) -> - case test_server:start_node(Name, slave, [{args, Args}]) of - {ok, Node} -> - {ok, Node}; - Error -> - ct:fail(Error) - end. - from(H, [H | T]) -> T; from(H, [_ | T]) -> from(H, T); from(_, []) -> []. -- cgit v1.2.3 From a4301978be3571a2caaf77da9e2d119750c8b894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 27 Apr 2016 13:41:24 +0200 Subject: compilation_SUITE: Use explicit exports With 'export_all' it is easy to add a new test case function and forget to add its name to the list of test cases to run. While we are it, remove unused functions and add the forgotten test case on_load_inline/1. --- lib/compiler/test/compilation_SUITE.erl | 101 +++++++++++++------------------- 1 file changed, 40 insertions(+), 61 deletions(-) (limited to 'lib/compiler/test/compilation_SUITE.erl') diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 9079e14e02..cd1bc099e9 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -19,11 +19,48 @@ %%% Purpose : Compiles various modules with tough code -module(compilation_SUITE). +-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1, + init_per_group/2,end_per_group/2, + beam_compiler_4/1, + beam_compiler_6/1, + beam_compiler_7/1, + beam_compiler_8/1, + beam_compiler_9/1, + beam_compiler_10/1, + beam_compiler_11/1, + compiler_1/1, + const_list_256/1, + convopts/1, + live_var/1, + on_load/1, + on_load_inline/1, + opt_crash/1, + otp_2330/1, + otp_2380/1, + otp_4790/1, + otp_5151/1, + otp_5235/1, + otp_5404/1, + otp_5436/1, + otp_5481/1, + otp_5553/1, + otp_5632/1, + otp_5714/1, + otp_5872/1, + otp_6121/1, + otp_7202/1, + otp_8949_a/1, + redundant_case/1, + self_compile/1, + self_compile_old_inliner/1, + split_cases/1, + string_table/1, + vsn_1/1, + vsn_2/1, + vsn_3/1]). -include_lib("common_test/include/ct.hrl"). --compile(export_all). - suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,10}}]. @@ -47,7 +84,7 @@ groups() -> otp_5151,otp_5235, opt_crash,otp_5404,otp_5436,otp_5481, otp_5553,otp_5632,otp_5714,otp_5872,otp_6121, - otp_7202,on_load, + otp_7202,on_load,on_load_inline, string_table,otp_8949_a,split_cases]}]. init_per_suite(Config) -> @@ -65,11 +102,7 @@ end_per_group(_GroupName, Config) -> -define(comp(N), N(Config) when is_list(Config) -> try_it(N, Config)). --define(comp_fail(N), - N(Config) when is_list(Config) -> failure(N, Config)). - ?comp(compiler_1). -?comp(compiler_4). ?comp(beam_compiler_4). ?comp(beam_compiler_6). @@ -77,7 +110,6 @@ end_per_group(_GroupName, Config) -> ?comp(beam_compiler_9). ?comp(beam_compiler_10). ?comp(beam_compiler_11). -?comp(beam_compiler_13). ?comp(otp_2330). ?comp(otp_2380). @@ -131,45 +163,6 @@ redundant_case_1(3) -> d; redundant_case_1(4) -> d; redundant_case_1(_) -> d. -failure(Module, Conf) -> - Src = filename:join(proplists:get_value(data_dir, Conf), - atom_to_list(Module)), - Out = proplists:get_value(priv_dir, Conf), - io:format("Compiling: ~ts\n", [Src]), - CompRc = compile:file(Src, [{outdir,Out},return,time]), - io:format("Result: ~p\n",[CompRc]), - case CompRc of - error -> ok; - {error,Errors,_} -> check_errors(Errors); - _ -> ct:fail({no_error, CompRc}) - end, - ok. - -check_errors([{_,Eds}|T]) -> - check_error(Eds), - check_errors(T); -check_errors([]) -> ok. - -check_error([{_,Mod,Error}|T]) -> - check_error_1(Mod:format_error(Error)), - check_error(T); -check_error([{Mod,Error}|T]) -> - check_error_1(Mod:format_error(Error)), - check_error(T); -check_error([]) -> ok. - -check_error_1(Str0) -> - Str = lists:flatten(Str0), - io:format("~s\n", [Str]), - case Str of - "internal"++_=Str -> - ct:fail(internal_compiler_error); - _ -> - ok - end. - --define(TC(Body), tc(fun() -> Body end, ?LINE)). - try_it(Module, Conf) -> Timetrap = {minutes,10}, OtherOpts = [], %Can be changed to [time] if needed @@ -239,16 +232,6 @@ load_and_call(Out, Module) -> ok. -tc(F, Line) -> - {Diff,Value} = timer:tc(erlang, apply, [F,[]]), - io:format("~p: ~p\n", [Line,Diff]), - Value. - -from(H, [H | T]) -> T; -from(H, [_ | T]) -> from(H, T); -from(_, []) -> []. - - %% Test generation of 'vsn' attribute. vsn_1(Conf) when is_list(Conf) -> M = vsn_1, @@ -388,10 +371,6 @@ compile_compiler(Files, OutDir, Version, InlineOpts) -> compiler_src() -> filelib:wildcard(filename:join([code:lib_dir(compiler), "src", "*.erl"])). -compiler_modules(Dir) -> - Files = filelib:wildcard(filename:join(Dir, "*.beam")), - [list_to_atom(filename:rootname(filename:basename(F))) || F <- Files]. - make_compiler_dir(Priv, Dir0) -> Dir = filename:join(Priv, Dir0), ok = file:make_dir(Dir), -- cgit v1.2.3