aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/bs_construct_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-10-10 16:00:04 +0200
committerBjörn Gustavsson <[email protected]>2012-10-10 16:00:04 +0200
commitb16c127d4dc2bb070d6e98e5c4cdc38220708a13 (patch)
tree60e0fe128f9fe6d36354952d70f06463683a112d /lib/compiler/test/bs_construct_SUITE.erl
parent55358002ddfa9f19e4142677d1ad4bd0a1760c0a (diff)
parente1aa422290b09a68bd761cbd0e70bd48442009b3 (diff)
downloadotp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.tar.gz
otp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.tar.bz2
otp-b16c127d4dc2bb070d6e98e5c4cdc38220708a13.zip
Merge branch 'bjorn/compiler/minor-optimization-polishing/OTP-10193'
* bjorn/compiler/minor-optimization-polishing/OTP-10193: (25 commits) beam_bsm: Handle calls slightly better Break apart tail-recursive call instructions Represent the 'send' instruction as a call_ext/2 instruction Rewrite select_val and select_tuple_arity to a select instruction Rewrite binary creation instructions to bs_init instructions Rewrite bs_add, bs_utf*_size to BIF instructions in optimizations Rewrite bs_put* instructions to a generic bs_put instruction Refactor removal of unused labels Introduce the mandatory beam_a and beam_z passes compile: Fix bug in selection of passes beam_receive: Optimize receives using refs created by spawn_monitor/{1,3} compile: Give a friendler error message if a parse transform cannot be found beam_jump: Don't move a block which can be entered via a fallthrough beam_jump: Fix broken optimization v3_kernel: Fix match code for matched out segment size in multiple clauses Improve binary matching of literals v3_codegen: Combine adjacent bs_match_string instructions beam_bool: Recognize more safe optimizations beam_utils: Correct usage calculations for GC BIFs in blocks beam_utils:live_opt/1: Correct liveness calculation for 'try' ...
Diffstat (limited to 'lib/compiler/test/bs_construct_SUITE.erl')
-rw-r--r--lib/compiler/test/bs_construct_SUITE.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl
index 9ab76449c7..a393aaeffd 100644
--- a/lib/compiler/test/bs_construct_SUITE.erl
+++ b/lib/compiler/test/bs_construct_SUITE.erl
@@ -360,6 +360,11 @@ in_catch(Config) when is_list(Config) ->
?line <<255>> = small(255, <<1,2,3,4,5,6,7,8,9>>),
?line <<1,2>> = small(<<7,8,9,10>>, 258),
?line <<>> = small(<<1,2,3,4,5>>, <<7,8,9,10>>),
+
+ <<15,240,0,42>> = small2(255, 42),
+ <<7:20>> = small2(<<1,2,3>>, 7),
+ <<300:12>> = small2(300, <<1,2,3>>),
+ <<>> = small2(<<1>>, <<2>>),
ok.
small(A, B) ->
@@ -381,6 +386,25 @@ small(A, B) ->
end,
<<ResA/binary,ResB/binary>>.
+small2(A, B) ->
+ case begin
+ case catch <<A:12>> of
+ {'EXIT',_} -> <<>>;
+ ResA0 -> ResA0
+ end
+ end of
+ ResA -> ok
+ end,
+ case begin
+ case catch <<B:20>> of
+ {'EXIT',_} -> <<>>;
+ ResB0 -> ResB0
+ end
+ end of
+ ResB -> ok
+ end,
+ <<ResA/binary-unit:1,ResB/binary-unit:1>>.
+
nasty_literals(Config) when is_list(Config) ->
case erlang:system_info(endian) of
big ->