File 0135-Cover-code-in-beam_trim.patch of Package erlang

From 36df00d48692c6f2e6d8c2ffd4eb03e4b66f56a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Thu, 29 Nov 2018 12:41:28 +0100
Subject: [PATCH 5/7] Cover code in beam_trim

---
 lib/compiler/test/bs_match_SUITE.erl | 33 +++++++++++++++++++++++++++++++++
 lib/compiler/test/map_SUITE.erl      | 14 ++++++++++++--
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 3d7a4e445a..440b632381 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -73,7 +73,7 @@
         t_reused_key_variable/1,
 
         %% new in OTP 22
-        t_mixed_clause/1
+        t_mixed_clause/1,cover_beam_trim/1
     ]).
 
 suite() -> [].
@@ -130,7 +130,7 @@ all() ->
         t_reused_key_variable,
 
         %% new in OTP 22
-        t_mixed_clause
+        t_mixed_clause,cover_beam_trim
     ].
 
 groups() -> [].
@@ -2182,6 +2182,16 @@ t_mixed_clause(_Config) ->
               end,
     ok.
 
+cover_beam_trim(_Config) ->
+    val = do_cover_beam_trim(id, max, max, id, #{id=>val}),
+    ok.
+
+do_cover_beam_trim(Id, OldMax, Max, Id, M) ->
+    OldMax = id(Max),
+    #{Id:=Val} = id(M),
+    Val.
+
+
 %% aux
 
 rand_terms(0) -> [];
-- 
2.16.4

openSUSE Build Service is sponsored by