diff options
author | John Högberg <[email protected]> | 2017-08-07 13:21:04 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-08-16 12:52:02 +0200 |
commit | b6d68726e39b13721fe7cce77b0a2ef90bdc53c9 (patch) | |
tree | 355a1370a127a3cede3ad7f94de363be32cb9646 /lib/compiler/test/beam_utils_SUITE.erl | |
parent | a748cafdc7063d9f181ba12088db6458793ced2f (diff) | |
download | otp-b6d68726e39b13721fe7cce77b0a2ef90bdc53c9.tar.gz otp-b6d68726e39b13721fe7cce77b0a2ef90bdc53c9.tar.bz2 otp-b6d68726e39b13721fe7cce77b0a2ef90bdc53c9.zip |
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]), |