aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/andor_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-03-16 12:18:39 +0100
committerBjörn Gustavsson <[email protected]>2015-03-16 12:18:39 +0100
commit2617c55b3a4ef635812df7cb62f6710b235ad9ef (patch)
treed2767561f112ab70da883c28b1ef3398fe07fbd1 /lib/compiler/test/andor_SUITE.erl
parentf1da7597dec858ee26dc68a6da66eb62742f82bb (diff)
parentb4061dfd6ef6f84379fd8a0988eed79cb0bb1972 (diff)
downloadotp-2617c55b3a4ef635812df7cb62f6710b235ad9ef.tar.gz
otp-2617c55b3a4ef635812df7cb62f6710b235ad9ef.tar.bz2
otp-2617c55b3a4ef635812df7cb62f6710b235ad9ef.zip
Merge branch 'bjorn/compiler/optimizations'
* bjorn/compiler/optimizations: v3_life: Combine literal/2 and literal2/2 v3_codegen: Don't save options in the process dictionary Don't inline core_parse v3_core: Teach pat_alias/2 to eliminate duplicated variables beam_dead: Improve optimization by eliminating fallthroughs beam_dead: Optimize Var =:= Var beam_peep: Optimize away redundant use of is_boolean tests beam_bool: Correct initialized_regs/2 sys_core_fold: Generalize case optimization sys_core_fold: Improve optimization of 'not' sys_core_fold: Suppress compiler warnings when evaluating element/2 Clean up evaluation of setelement/3 Replace '==' with '=:=' when both operands are integers Update type information based on BIFs that returns integers sys_core_fold: Strengthen type optimization in lets
Diffstat (limited to 'lib/compiler/test/andor_SUITE.erl')
-rw-r--r--lib/compiler/test/andor_SUITE.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl
index 3199440d84..4d7f444c4f 100644
--- a/lib/compiler/test/andor_SUITE.erl
+++ b/lib/compiler/test/andor_SUITE.erl
@@ -370,6 +370,11 @@ combined(Config) when is_list(Config) ->
?line true = ?COMB(false, blurf, true),
?line true = ?COMB(true, true, blurf),
+ false = simple_comb(false, false),
+ false = simple_comb(false, true),
+ false = simple_comb(true, false),
+ true = simple_comb(true, true),
+
ok.
-undef(COMB).
@@ -396,6 +401,13 @@ comb(A, B, C) ->
end,
id(Res).
+simple_comb(A, B) ->
+ %% Use Res twice, to ensure that a careless optimization of 'not'
+ %% doesn't leave Res as a free variable.
+ Res = A andalso B,
+ _ = id(not Res),
+ Res.
+
%% Test that a boolean expression in a case expression is properly
%% optimized (in particular, that the error behaviour is correct).
in_case(Config) when is_list(Config) ->