aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/beam_block_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-06-03 11:57:45 +0200
committerBjörn Gustavsson <[email protected]>2016-06-03 11:57:45 +0200
commitb9f8fee6ab5088825f53bfa5dcfdca2ffa81288d (patch)
tree92ed0d8617d36ae9248195044b10c096d59285bd /lib/compiler/test/beam_block_SUITE.erl
parent7d51cf9c8ce2062ed89ea6f8f24f01f826abc90b (diff)
parent819d11e4a8f67cbe5c6fa60580e47a5b884040d7 (diff)
downloadotp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.gz
otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.bz2
otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.zip
Merge branch 'bjorn/compiler/misc'
* bjorn/compiler/misc: misc_SUITE: Cover the remaining lines in beam_peep Avoid the dreaded "no_file" in warnings Eliminate crash for map updates in guards beam_block: Eliminate crash in beam_utils
Diffstat (limited to 'lib/compiler/test/beam_block_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_block_SUITE.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_block_SUITE.erl b/lib/compiler/test/beam_block_SUITE.erl
index d343e26737..4bcb252833 100644
--- a/lib/compiler/test/beam_block_SUITE.erl
+++ b/lib/compiler/test/beam_block_SUITE.erl
@@ -21,7 +21,7 @@
-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
init_per_group/2,end_per_group/2,
- get_map_elements/1,otp_7345/1]).
+ get_map_elements/1,otp_7345/1,move_opt_across_gc_bif/1]).
%% The only test for the following functions is that
%% the code compiles and is accepted by beam_validator.
@@ -36,7 +36,8 @@ all() ->
groups() ->
[{p,[parallel],
[get_map_elements,
- otp_7345
+ otp_7345,
+ move_opt_across_gc_bif
]}].
init_per_suite(Config) ->
@@ -118,6 +119,22 @@ otp_7345(ObjRef, _RdEnv, Args) ->
10},
id(LlUnitdataReq).
+
+%% Doing move optimizations across GC bifs are in general not safe.
+move_opt_across_gc_bif(_Config) ->
+ [0,true,1] = positive(speaking),
+ ok.
+
+positive(speaking) ->
+ try
+ Positive = 0,
+ [+Positive, case Positive of _ -> true end, paris([], Positive)]
+ after
+ mailing
+ end.
+
+paris([], P) -> P + 1.
+
%%%
%%% The only test of the following code is that it compiles.
%%%