diff options
author | Björn Gustavsson <[email protected]> | 2018-08-09 13:59:10 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-08-09 13:59:10 +0200 |
commit | 4dcc640791674ee7d28fb2e29a064175ceb46f2a (patch) | |
tree | 5cd25f8fbebaa82b6769d4e9db175accd96f5b0f /lib/compiler/test/core_fold_SUITE.erl | |
parent | ca9f2fe073b587e70b5502c87be3eca6f72ddd57 (diff) | |
parent | a2b94643d345505bcee103b114147e3cb962b8ac (diff) | |
download | otp-4dcc640791674ee7d28fb2e29a064175ceb46f2a.tar.gz otp-4dcc640791674ee7d28fb2e29a064175ceb46f2a.tar.bz2 otp-4dcc640791674ee7d28fb2e29a064175ceb46f2a.zip |
Merge pull request #1910 from bjorng/bjorn/compiler/letrec-side-effect-fix/ERL-658/OTP-15188
Fix side-effect optimization when compiling from Core Erlang
Diffstat (limited to 'lib/compiler/test/core_fold_SUITE.erl')
-rw-r--r-- | lib/compiler/test/core_fold_SUITE.erl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 2a2369fff9..47606014c3 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -28,7 +28,7 @@ mixed_matching_clauses/1,unnecessary_building/1, no_no_file/1,configuration/1,supplies/1, redundant_stack_frame/1,export_from_case/1, - empty_values/1]). + empty_values/1,cover_letrec_effect/1]). -export([foo/0,foo/1,foo/2,foo/3]). @@ -48,7 +48,7 @@ groups() -> mixed_matching_clauses,unnecessary_building, no_no_file,configuration,supplies, redundant_stack_frame,export_from_case, - empty_values]}]. + empty_values,cover_letrec_effect]}]. init_per_suite(Config) -> @@ -598,5 +598,25 @@ empty_values(_Config) -> do_empty_values() when (#{})#{} -> c. +cover_letrec_effect(_Config) -> + self() ! {tag,42}, + _ = try + try + ignore + after + receive + {tag,Int}=Term -> + Res = #{k => {Term,<<Int:16>>}}, + self() ! Res + end + end + after + ok + end, + receive + Any -> + #{k := {{tag,42},<<42:16>>}} = Any + end, + ok. id(I) -> I. |