aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/error_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-10-10 16:00:04 +0200
committerBjörn Gustavsson <[email protected]>2012-10-10 16:00:04 +0200
commitb16c127d4dc2bb070d6e98e5c4cdc38220708a13 (patch)
tree60e0fe128f9fe6d36354952d70f06463683a112d /lib/compiler/test/error_SUITE.erl
parent55358002ddfa9f19e4142677d1ad4bd0a1760c0a (diff)
parente1aa422290b09a68bd761cbd0e70bd48442009b3 (diff)
downloadotp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.tar.gz
otp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.tar.bz2
otp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.zip
Merge branch 'bjorn/compiler/minor-optimization-polishing/OTP-10193'
* bjorn/compiler/minor-optimization-polishing/OTP-10193: (25 commits) beam_bsm: Handle calls slightly better Break apart tail-recursive call instructions Represent the 'send' instruction as a call_ext/2 instruction Rewrite select_val and select_tuple_arity to a select instruction Rewrite binary creation instructions to bs_init instructions Rewrite bs_add, bs_utf*_size to BIF instructions in optimizations Rewrite bs_put* instructions to a generic bs_put instruction Refactor removal of unused labels Introduce the mandatory beam_a and beam_z passes compile: Fix bug in selection of passes beam_receive: Optimize receives using refs created by spawn_monitor/{1,3} compile: Give a friendler error message if a parse transform cannot be found beam_jump: Don't move a block which can be entered via a fallthrough beam_jump: Fix broken optimization v3_kernel: Fix match code for matched out segment size in multiple clauses Improve binary matching of literals v3_codegen: Combine adjacent bs_match_string instructions beam_bool: Recognize more safe optimizations beam_utils: Correct usage calculations for GC BIFs in blocks beam_utils:live_opt/1: Correct liveness calculation for 'try' ...
Diffstat (limited to 'lib/compiler/test/error_SUITE.erl')
-rw-r--r--lib/compiler/test/error_SUITE.erl26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index fb51e013ce..e798023cd8 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -22,13 +22,17 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
- head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]).
+ head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1,
+ transforms/1]).
+
+%% Used by transforms/1 test case.
+-export([parse_transform/2]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
- [head_mismatch_line, warnings_as_errors, bif_clashes].
+ [head_mismatch_line, warnings_as_errors, bif_clashes, transforms].
groups() ->
[].
@@ -216,6 +220,24 @@ warnings_as_errors(Config) when is_list(Config) ->
ok.
+transforms(Config) ->
+ Ts1 = [{undef_parse_transform,
+ <<"
+ -compile({parse_transform,non_existing}).
+ ">>,
+ [return],
+ {error,[{none,compile,{undef_parse_transform,non_existing}}],[]}}],
+ [] = run(Config, Ts1),
+ Ts2 = <<"
+ -compile({parse_transform,",?MODULE_STRING,"}).
+ ">>,
+ {error,[{none,compile,{parse_transform,?MODULE,{too_bad,_}}}],[]} =
+ run_test(Ts2, test_filename(Config), [], dont_write_beam),
+ ok.
+
+parse_transform(_, _) ->
+ error(too_bad).
+
run(Config, Tests) ->
?line File = test_filename(Config),