diff options
author | Erlang/OTP <[email protected]> | 2017-10-05 16:58:13 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2017-10-05 16:58:13 +0200 |
commit | 74c9c2159b234317e5857de4f39318b50aa2d628 (patch) | |
tree | e5bbd3fdac8556f108d0538aba1ada54caa18996 /lib/compiler/test/beam_utils_SUITE.erl | |
parent | 0c0d7899f869eae275a9dd2677791f34bbd25bfe (diff) | |
parent | 9beb6d48a12ae4e7abdacbed42b5269121f2fee7 (diff) | |
download | otp-74c9c2159b234317e5857de4f39318b50aa2d628.tar.gz otp-74c9c2159b234317e5857de4f39318b50aa2d628.tar.bz2 otp-74c9c2159b234317e5857de4f39318b50aa2d628.zip |
Merge branch 'john/compiler/fail-labels-in-blocks-otp-19/ERIERL-48/OTP-14522' into maint-19
* john/compiler/fail-labels-in-blocks-otp-19/ERIERL-48/OTP-14522:
compiler: Fix live regs update on allocate in validator
Take fail labels into account when determining liveness in block ops
Diffstat (limited to 'lib/compiler/test/beam_utils_SUITE.erl')
-rw-r--r-- | lib/compiler/test/beam_utils_SUITE.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/compiler/test/beam_utils_SUITE.erl b/lib/compiler/test/beam_utils_SUITE.erl index b76b4d17df..ac734a70be 100644 --- a/lib/compiler/test/beam_utils_SUITE.erl +++ b/lib/compiler/test/beam_utils_SUITE.erl @@ -260,6 +260,14 @@ otp_8949_b(A, B) -> liveopt(_Config) -> F = liveopt_fun(42, pebkac, user), void = F(42, #alarmInfo{type=sctp,cause=pebkac,origin=user}), + + + A = {#alarmInfo{cause = {abc, def}}, ghi}, + A = liveopt_guard_bif(A), + + B = {#alarmInfo{cause = {abc}}, def}, + {#alarmInfo{cause = {{abc}}}, def} = liveopt_guard_bif(B), + ok. liveopt_fun(Peer, Cause, Origin) -> @@ -271,6 +279,15 @@ liveopt_fun(Peer, Cause, Origin) -> void end. +liveopt_guard_bif({#alarmInfo{cause=F}=R, X}=A) -> + %% ERIERL-48 + if + is_tuple(F), tuple_size(F) == 2 -> A; + true -> + R2 = R#alarmInfo{cause={F}}, + {R2,X} + end. + %% Thanks to QuickCheck. coverage(_Config) -> 42+7 = merchant([[],7,false]), |