aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/misc_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-04 11:40:08 +0100
committerBjörn Gustavsson <[email protected]>2012-01-04 11:40:08 +0100
commitca5c9b93a0527c95977cb276ab957acc1ca404fa (patch)
treefcd6e64324f25b0a415380764441bc2f0181c303 /lib/compiler/test/misc_SUITE.erl
parentc9b489be03b0fce477e807182846c03fb200ef94 (diff)
parent726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b (diff)
downloadotp-ca5c9b93a0527c95977cb276ab957acc1ca404fa.tar.gz
otp-ca5c9b93a0527c95977cb276ab957acc1ca404fa.tar.bz2
otp-ca5c9b93a0527c95977cb276ab957acc1ca404fa.zip
Merge branch 'bjorn/compiler/match-fail/OTP-9842' into maint
* bjorn/compiler/match-fail/OTP-9842: Add the beam_except pass to optimize exceptions Eliminate the match_fail primop in v3_kernel and later passes
Diffstat (limited to 'lib/compiler/test/misc_SUITE.erl')
-rw-r--r--lib/compiler/test/misc_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl
index 9b414cade6..5e13a93c52 100644
--- a/lib/compiler/test/misc_SUITE.erl
+++ b/lib/compiler/test/misc_SUITE.erl
@@ -190,6 +190,15 @@ silly_coverage(Config) when is_list(Config) ->
{label,2}|non_proper_list]}],99},
?line expect_error(fun() -> beam_block:module(BlockInput, []) end),
+ %% beam_except
+ ExceptInput = {?MODULE,[{foo,0}],[],
+ [{function,foo,0,2,
+ [{label,1},
+ {line,loc},
+ {func_info,{atom,?MODULE},{atom,foo},0},
+ {label,2}|non_proper_list]}],99},
+ expect_error(fun() -> beam_except:module(ExceptInput, []) end),
+
%% beam_bool
BoolInput = {?MODULE,[{foo,0}],[],
[{function,foo,0,2,
@@ -253,8 +262,15 @@ expect_error(Fun) ->
io:format("~p", [Any]),
?t:fail(call_was_supposed_to_fail)
catch
- _:_ ->
- io:format("~p\n", [erlang:get_stacktrace()])
+ Class:Reason ->
+ Stk = erlang:get_stacktrace(),
+ io:format("~p:~p\n~p\n", [Class,Reason,Stk]),
+ case {Class,Reason} of
+ {error,undef} ->
+ ?t:fail(not_supposed_to_fail_with_undef);
+ {_,_} ->
+ ok
+ end
end.
confused_literals(Config) when is_list(Config) ->