diff options
author | Björn Gustavsson <[email protected]> | 2013-06-03 11:53:37 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-06-03 11:53:37 +0200 |
commit | 7a1cf0d233d8e3981f1e4a822aa1837591697c3a (patch) | |
tree | e1c852da8dd1d0e12bf9aa5546eb48a19df79415 /lib/compiler/test/receive_SUITE.erl | |
parent | 7417446d0e3c4e5e5a15f60b1879cabef1e26408 (diff) | |
parent | 2b1bf52eb71f0305247f95d4b10ba49a271a458c (diff) | |
download | otp-7a1cf0d233d8e3981f1e4a822aa1837591697c3a.tar.gz otp-7a1cf0d233d8e3981f1e4a822aa1837591697c3a.tar.bz2 otp-7a1cf0d233d8e3981f1e4a822aa1837591697c3a.zip |
Merge branch 'bjorn/compiler/fix-compiler-crash/OTP-11119' into maint
* bjorn/compiler/fix-compiler-crash/OTP-11119:
compiler: Correct liveness optimization for wait/1
Diffstat (limited to 'lib/compiler/test/receive_SUITE.erl')
-rw-r--r-- | lib/compiler/test/receive_SUITE.erl | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index e60584d4ab..ec49267ded 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -23,7 +23,8 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 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]). + export/1,recv/1,coverage/1,otp_7980/1,ref_opt/1, + wait/1]). -include_lib("test_server/include/test_server.hrl"). @@ -44,7 +45,7 @@ all() -> groups() -> [{p,test_lib:parallel(), - [recv,coverage,otp_7980,ref_opt,export]}]. + [recv,coverage,otp_7980,ref_opt,export,wait]}]. init_per_suite(Config) -> @@ -252,4 +253,20 @@ export_1(Reference) -> id({build,self()}), Result. +wait(Config) when is_list(Config) -> + self() ! <<42>>, + <<42>> = wait_1(r, 1, 2), + {1,2,3} = wait_1(1, 2, 3), + ok. + +wait_1(r, _, _) -> + receive + B when byte_size(B) > 0 -> + B + end; +%% beam_utils would wrongly assume that wait/1 could fall through +%% to the next clause. +wait_1(A, B, C) -> + {A,B,C}. + id(I) -> I. |