summaryrefslogtreecommitdiff
path: root/lib/compiler/test/bs_bincomp_SUITE.erl
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearHenrik Nord2018-09-211-1/+1
|
* Abort size calculation when a matched-out variable is usedJohn Högberg2018-07-161-2/+9
| | | | | | | | Referencing a matched-out variable in a size expression makes it impossible to calculate the size of the result based on the size of the matched binary. The compiler would still generate code to do this however, which would crash since the variable isn't defined at the size calculation.
* Call test_lib:recompile/1 from init_per_suite/1Björn Gustavsson2018-07-061-1/+1
| | | | | | | Call test_lib:recompile/1 from init_per_suite/1 instead of from all/0. That makes it easy to find the log from the compilation in the log file for the init_per_suite/1 test case.
* Move expansion of strings in binaries to v3_coreJosé Valim2016-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This speeds up the compilation of binary literals with string values in them. For example, compiling a file with a ~340kB binary would yield the following times by the compiler: Compiling "foo" parse_module : 0.130 s 5327.6 kB transform_module : 0.000 s 5327.6 kB lint_module : 0.011 s 5327.8 kB expand_module : 0.508 s 71881.2 kB v3_core : 0.463 s 11.5 kB Notice the increase in memory and processing time in expand_module and v3_core. This happened because expand_module would expand the string in binaries into chars. For example, the binary <<"foo">>, which is represented as {bin, 1, [ {bin_element, 1, {string, 1, "foo"}, default, default} ]} would be converted to {bin, 1, [ {bin_element, 1, {char, 1, $f}, default, default}, {bin_element, 1, {char, 1, $o}, default, default}, {bin_element, 1, {char, 1, $o}, default, default} ]} However, v3_core would then traverse all of those characters and convert it into an actual binary, as it is a literal value. This patch addresses this issue by moving the expansion of string into chars to v3_core and only if a literal value cannot not be built. This reduces the compilation time of the file mentioned above to the values below: Compiling "bar" parse_module : 0.134 s 5327.6 kB transform_module : 0.000 s 5327.6 kB lint_module : 0.005 s 5327.8 kB expand_module : 0.000 s 5328.7 kB v3_core : 0.013 s 11.2 kB
* update copyright-yearHenrik Nord2016-03-151-1/+1
|
* Generalize bit string comprehensionsBjörn Gustavsson2016-03-011-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The expression in a bit string comprehension is limited to a literal bit string expression. That is, the following code is legal: << <<X>> || X <- List >> but not this code: << foo(X) || X <- List >> The limitation is annoying. For one thing, tools that transform the abstract format must be careful not to produce code such as: << begin %% Some instrumentation code. <<X>> end || X <- List >> One reason for the limitation could be that we'll get reduce/reduce conflicts if we try to allow an arbitrary expression in a bit string comprehension: binary_comprehension -> '<<' expr '||' lc_exprs '>>' : {bc,?anno('$1'),'$2','$4'}. Unfortunately, there does not seem to be an easy way to work around that problem. The best we can do is to allow 'expr_max' expressions (as in the binary syntax): binary_comprehension -> '<<' expr_max '||' lc_exprs '>>' : {bc,?anno('$1'),'$2','$4'}. That will work, but functions calls must be enclosed in parentheses: << (foo(X)) || X <- List >>
* Remove ?line macrosBjörn Gustavsson2016-02-251-98/+102
|
* Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson2016-02-171-1/+1
| | | | | | | As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl.
* Change license text to APLv2Bruce Yinhe2015-06-181-10/+11
|
* Merge branch 'nox/illegal-bitstring-gen-pattern/OTP-11186'Fredrik Gustafsson2013-06-261-36/+2
|\ | | | | | | | | | | | | * nox/illegal-bitstring-gen-pattern/OTP-11186: Bootstrap added Simplify v3_core's translation of bit string generators Forbid unsized fields in patterns of binary generators
| * Forbid unsized fields in patterns of binary generatorsAnthony Ramine2013-06-051-36/+2
| | | | | | | | | | It makes no sense to be able to do `<<...,Rest/binary>> <= ...` in a comprehension. The related Dialyzer test is removed.
* | Update copyright yearsBjörn-Egil Dahlberg2013-06-121-1/+1
|/
* Fix optimization of some binary comprehensionsAnthony Ramine2013-03-281-0/+3
| | | | | | | | | | | If a variable bound in a generator is used as the size of a segment in the comprehension body, v3_core uses this variable in the code generated to compute the initial size given to the `bs_init_writable` primop before the variable is actually bound, as in: << <<0:S>> || S <- Slist >> Reported-By: Peer Stritzinger
* compiler tests: Reinstate ?MODULE macro in calls to test_lib:recompile/1Björn Gustavsson2011-04-121-1/+1
| | | | | | | | | In 3d0f4a3085f11389e5b22d10f96f0cbf08c9337f (an update to conform with common_test), in all test_lib:recompile(?MODULE) calls, ?MODULE was changed to the actual name of the module. That would cause test_lib:recompile/1 to compile the module with the incorrect compiler options in cloned modules such as record_no_opt_SUITE, causing worse coverage.
* Update copyright yearsBjörn-Egil Dahlberg2011-03-111-1/+1
|
* Rename Suite Callback to Common Test HookLukas Larsson2011-02-171-1/+1
|
* Fix formatting for compilerLukas Larsson2011-02-171-1/+2
|
* Add init_per_suite and end_per_suiteLukas Larsson2011-02-171-1/+7
|
* Add ts_install_scb to suite/0Lukas Larsson2011-02-171-1/+3
|
* Update compiler tests to conform with common_test standardLukas Larsson2011-02-171-7/+15
|
* Add tests for tail segments in binary generatorsBjörn Gustavsson2010-09-221-3/+35
|
* The R13B03 release.OTP_R13B03Erlang/OTP2009-11-201-0/+297