aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-04-11 14:55:28 +0200
committerBjörn Gustavsson <[email protected]>2011-04-12 05:54:47 +0200
commit2c67e91d20daf46e4ffff91b10208768d97e8ec8 (patch)
treed6b28fa6b4703431c84147b6c165eb640deb7f10 /lib/compiler/test
parentdf96e44eb23abdb696eb79ecc92ce4f8bbb534a1 (diff)
downloadotp-2c67e91d20daf46e4ffff91b10208768d97e8ec8.tar.gz
otp-2c67e91d20daf46e4ffff91b10208768d97e8ec8.tar.bz2
otp-2c67e91d20daf46e4ffff91b10208768d97e8ec8.zip
match_SUITE: Cover a clause in beam_dead:forward/4
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/match_SUITE.erl18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl
index cf5ecf4fc2..9406d7de8f 100644
--- a/lib/compiler/test/match_SUITE.erl
+++ b/lib/compiler/test/match_SUITE.erl
@@ -22,7 +22,7 @@
init_per_group/2,end_per_group/2,
pmatch/1,mixed/1,aliases/1,match_in_call/1,
untuplify/1,shortcut_boolean/1,letify_guard/1,
- selectify/1,underscore/1]).
+ selectify/1,underscore/1,coverage/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,7 +31,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
[pmatch, mixed, aliases, match_in_call, untuplify,
- shortcut_boolean, letify_guard, selectify, underscore].
+ shortcut_boolean, letify_guard, selectify, underscore, coverage].
groups() ->
[].
@@ -398,4 +398,18 @@ underscore(Config) when is_list(Config) ->
_ = is_list(Config),
ok.
+coverage(Config) when is_list(Config) ->
+ %% Cover beam_dead.
+ ok = coverage_1(x, a),
+ ok = coverage_1(x, b).
+
+coverage_1(B, Tag) ->
+ case Tag of
+ a -> coverage_2(1, a, B);
+ b -> coverage_2(2, b, B)
+ end.
+
+coverage_2(1, a, x) -> ok;
+coverage_2(2, b, x) -> ok.
+
id(I) -> I.