summaryrefslogtreecommitdiff
path: root/lib/compiler/test/receive_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2019-10-14 11:53:10 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2019-10-14 12:32:53 +0200
commit8655f46177a47e6565629f6fa3ce9c86a2dc8892 (patch)
tree7cf5f9ae1d64bf7b6a3bb26701ff3dd59c8ba6ce /lib/compiler/test/receive_SUITE.erl
parentde95f2357a92265cec07955fc7d703eba20abd72 (diff)
downloaderlang-8655f46177a47e6565629f6fa3ce9c86a2dc8892.tar.gz
Cover beam_ssa_opt:opt_ssa_sink/1
Diffstat (limited to 'lib/compiler/test/receive_SUITE.erl')
-rw-r--r--lib/compiler/test/receive_SUITE.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl
index 49a57cd1ff..f9f59207c8 100644
--- a/lib/compiler/test/receive_SUITE.erl
+++ b/lib/compiler/test/receive_SUITE.erl
@@ -135,6 +135,11 @@ coverage(Config) when is_list(Config) ->
{'EXIT',{{badmap,[]},_}} = (catch monitor_plus_badmap(self())),
+
+ self() ! {data,no_data},
+ ok = receive_sink_tuple({any,pattern}),
+ {b,a} = receive_sink_tuple({a,b}),
+
ok.
monitor_plus_badmap(Pid) ->
@@ -183,6 +188,16 @@ tuple_to_values(Timeout, X) ->
end,
A+B.
+%% Cover a help function for beam_ssa_opt:ssa_opt_sink/1.
+receive_sink_tuple({Line,Pattern}) ->
+ receive
+ {data,_} ->
+ ok
+ after 1 ->
+ id({Pattern,Line})
+ end.
+
+
%% OTP-7980. Thanks to Vincent de Phily. The following code would
%% be inccorrectly optimized by beam_jump.