summaryrefslogtreecommitdiff
path: root/lib/compiler/test/beam_block_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/test/beam_block_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_block_SUITE.erl35
1 files changed, 33 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_block_SUITE.erl b/lib/compiler/test/beam_block_SUITE.erl
index 9ccc8aa36d..f5a816fb9c 100644
--- a/lib/compiler/test/beam_block_SUITE.erl
+++ b/lib/compiler/test/beam_block_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015-2021. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -307,8 +307,16 @@ second_block_pass(_Config) ->
second_1(Fs, TS) ->
[F#{dts=>DTS / TS} || #{dts:=DTS} = F <- Fs].
-coverage(_Config) ->
+coverage(Config) ->
[] = coverage_1(),
+
+ [42,Config] = (coverage_2(Config))({fun id/1}),
+
+ {b,a,badarith} = coverage_3(a, b),
+ ok = coverage_3(0, 1),
+
+ {'EXIT',{badarg,_}} = catch coverage_4(a, b),
+
ok.
coverage_1() ->
@@ -316,6 +324,29 @@ coverage_1() ->
[] -> whatever
end) || 7 <- []].
+coverage_2(Cmds) ->
+ fun({CollecFun}) ->
+ [id(42), CollecFun(Cmds)]
+ end.
+
+coverage_3(Node, Nodes) ->
+ try id(Node) + 1 of
+ _ ->
+ ok
+ catch
+ _:Reason ->
+ coverage_3(Nodes, Node, Reason)
+ end.
+
+coverage_3(A, B, C) ->
+ id({A,B,C}).
+
+coverage_4(A, B) ->
+ do_coverage_4(ok, (ok xor ok)#{ok := ok}, B, ok) =:= A.
+
+do_coverage_4(_, _, _, _) ->
+ ok.
+
%%%
%%% Common functions.
%%%