aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/beam_bool_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/test/beam_bool_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_bool_SUITE.erl41
1 files changed, 39 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_bool_SUITE.erl b/lib/compiler/test/beam_bool_SUITE.erl
index 84d634e5ca..e585eaedb5 100644
--- a/lib/compiler/test/beam_bool_SUITE.erl
+++ b/lib/compiler/test/beam_bool_SUITE.erl
@@ -22,7 +22,8 @@
-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
init_per_group/2,end_per_group/2,
before_and_inside_if/1,
- scotland/1,y_registers/1]).
+ scotland/1,y_registers/1,protected/1,
+ maps/1]).
suite() ->
[{ct_hooks,[ts_install_cth]}].
@@ -35,7 +36,9 @@ groups() ->
[{p,[parallel],
[before_and_inside_if,
scotland,
- y_registers
+ y_registers,
+ protected,
+ maps
]}].
init_per_suite(Config) ->
@@ -158,3 +161,37 @@ potter(Modes) ->
_ -> not_ok
end,
{Final,Raw}.
+
+protected(_Config) ->
+ {'EXIT',{if_clause,_}} = (catch photographs({1, surprise, true}, opinions)),
+
+ {{true}} = welcome({perfect, true}),
+ {'EXIT',{if_clause,_}} = (catch welcome({perfect, false})),
+ ok.
+
+photographs({_Violation, surprise, Deep}, opinions) ->
+ {if
+ 0; "here", Deep ->
+ Deep = Deep
+ end}.
+
+welcome({perfect, Profit}) ->
+ if
+ Profit, Profit, Profit; 0 ->
+ {id({Profit})}
+ end.
+
+maps(_Config) ->
+ ok = evidence(#{0 => 42}).
+
+%% Cover handling of put_map in in split_block_label_used/2.
+evidence(#{0 := Charge}) when 0; #{[] => Charge} == #{[] => 42} ->
+ ok.
+
+
+%%%
+%%% Common utilities.
+%%%
+
+id(I) ->
+ I.