aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-12-26 21:26:48 +0100
committerBjörn Gustavsson <[email protected]>2015-01-09 13:18:45 +0100
commitc4e9c42a0a4b662d4e85fe583191267e135d5176 (patch)
tree3cb12fbfd71346b480bfd59347a171afdb377e65 /lib
parent4ed58c9dead7e7857b43e5313f1337a5214ba551 (diff)
downloadotp-c4e9c42a0a4b662d4e85fe583191267e135d5176.tar.gz
otp-c4e9c42a0a4b662d4e85fe583191267e135d5176.tar.bz2
otp-c4e9c42a0a4b662d4e85fe583191267e135d5176.zip
misc_SUITE: Cover the exception handling code in beam_dead
Amend the test suite to call beam_dead as originally intended (and not beam_block), and modify the input data so that the exception will occur within the try ... catch block in function/2.
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/test/misc_SUITE.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl
index 44c7161530..5416e8b6c7 100644
--- a/lib/compiler/test/misc_SUITE.erl
+++ b/lib/compiler/test/misc_SUITE.erl
@@ -225,14 +225,15 @@ silly_coverage(Config) when is_list(Config) ->
{label,2}|non_proper_list]}],99},
?line expect_error(fun() -> beam_bool:module(BoolInput, []) end),
- %% beam_dead
+ %% beam_dead. This is tricky. Our function must look OK to
+ %% beam_utils:clean_labels/1, but must crash beam_dead.
DeadInput = {?MODULE,[{foo,0}],[],
[{function,foo,0,2,
[{label,1},
{func_info,{atom,?MODULE},{atom,foo},0},
{label,2},
- {jump,bad}]}],99},
- ?line expect_error(fun() -> beam_block:module(DeadInput, []) end),
+ {test,is_eq_exact,{f,1},[bad,operands]}]}],99},
+ expect_error(fun() -> beam_dead:module(DeadInput, []) end),
%% beam_clean
CleanInput = {?MODULE,[{foo,0}],[],