aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2017-08-24 09:42:38 +0200
committerRaimo Niskanen <[email protected]>2017-08-24 09:42:38 +0200
commit6c4b60d6b9208bdc5eef3f0f2da220fbce890938 (patch)
tree6185629a54bd409a072892b51c311d44ef409be1 /lib/compiler/test
parentdb8fba1aace21af71e015e2620ed6e7c1a5bfab2 (diff)
parent710f9437498a8a9df62a6c7cecd6eb632561754b (diff)
downloadotp-6c4b60d6b9208bdc5eef3f0f2da220fbce890938.tar.gz
otp-6c4b60d6b9208bdc5eef3f0f2da220fbce890938.tar.bz2
otp-6c4b60d6b9208bdc5eef3f0f2da220fbce890938.zip
Merge branch 'maint'
Conflicts: OTP_VERSION
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]),