diff options
author | John Högberg <[email protected]> | 2019-01-21 07:35:55 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-01-21 07:51:06 +0100 |
commit | 2d96971a96868d70a750422788d1493a5cbed605 (patch) | |
tree | 0a415ee73d923ce86bab5ed42b62fb97906fc33f /lib/compiler/test | |
parent | b46fe99e5fa3d96f0ae647f11956e5777d6bb1fe (diff) | |
download | otp-2d96971a96868d70a750422788d1493a5cbed605.tar.gz otp-2d96971a96868d70a750422788d1493a5cbed605.tar.bz2 otp-2d96971a96868d70a750422788d1493a5cbed605.zip |
beam_ssa_type: Remove wait_timeout instructions with a timeout of 0
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/receive_SUITE.erl | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 4219768d6f..12108445f0 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -25,7 +25,7 @@ init_per_group/2,end_per_group/2, init_per_testcase/2,end_per_testcase/2, export/1,recv/1,coverage/1,otp_7980/1,ref_opt/1, - wait/1,recv_in_try/1,double_recv/1]). + wait/1,recv_in_try/1,double_recv/1,receive_var_zero/1]). -include_lib("common_test/include/ct.hrl"). @@ -45,7 +45,7 @@ all() -> groups() -> [{p,test_lib:parallel(), [recv,coverage,otp_7980,ref_opt,export,wait, - recv_in_try,double_recv]}]. + recv_in_try,double_recv,receive_var_zero]}]. init_per_suite(Config) -> @@ -378,4 +378,27 @@ do_double_recv(_, Msg) -> error end. +%% Test 'after Z', when Z =:= 0 been propagated as an immediate by the type +%% optimization pass. +receive_var_zero(Config) when is_list(Config) -> + self() ! x, + self() ! y, + Z = zero(), + timeout = receive + z -> ok + after Z -> timeout + end, + timeout = receive + after Z -> timeout + end, + self() ! w, + receive + x -> ok; + Other -> + ct:fail({bad_message,Other}) + end. + +zero() -> 0. + + id(I) -> I. |