aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-08-23 10:39:20 +0200
committerErlang/OTP <[email protected]>2017-08-23 10:39:20 +0200
commit345a79ac188caa24229195991ed134e1e4df8179 (patch)
tree977f36798dd0450fcd43bf3cce35c12fc77dac8b /lib/compiler/test
parent6ede2da826335960037299d9f3b0e66d072ea5a0 (diff)
parent9beb6d48a12ae4e7abdacbed42b5269121f2fee7 (diff)
downloadotp-345a79ac188caa24229195991ed134e1e4df8179.tar.gz
otp-345a79ac188caa24229195991ed134e1e4df8179.tar.bz2
otp-345a79ac188caa24229195991ed134e1e4df8179.zip
Merge branch 'john/compiler/fail-labels-in-blocks-otp-19/ERIERL-48/OTP-14522' into maint-20
* 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')
-rw-r--r--lib/compiler/test/beam_utils_SUITE.erl17
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 a3f1bb93fe..710cb050d4 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]),