aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/compile_SUITE.erl
AgeCommit message (Collapse)Author
2016-06-07Compiler: new function env_compiler_options/0alisdair sullivan
retrieve the value of the environment variable ERL_COMPILER_OPTIONS in the same manner as used by file/2, forms/2 and output_generated/2
2016-05-13compile_SUITE: Cover numeric variable names in core_ppBjörn Gustavsson
The inliner generates variable whose names are numeric. Run the inliner to cover one more line in core_pp.
2016-05-13compile_SUITE: Eliminate clones when re-compiling test suitesBjörn Gustavsson
Several test cases in compile_SUITE (e.g. core/1) extracts the abstract code from a BEAM file and runs the compiler on it. It is only a waste of time to use the abstract code from cloned versions of test case modules. That is, use record_SUITE, but don't use record_no_opt_SUITE, record_post_opt_SUITE, or record_inline_SUITE since they all contain essentially the same abstract code.
2016-04-27Remove toothless test compile_SUITE:missing_testheap/1Björn Gustavsson
missing_testheap/1 is no longer relevant for the following reasons: 1) Because of the literal pool introduced in R12, no test_heap instructions are needed in the guards. 2) beam_validator would abort the compilation if any needed test_heap instructions were missing.
2016-04-25compiler: Remove use of crypto:rand_bytes/1Ingela Anderton Andin
Use case in compile.erl is cryptographical so use crypto:strong_rand_bytes/1 instead. Use case in test suite is not cryptographical so use other test instead.
2016-04-21Add compile_SUITE:core_roundtrip/1Björn Gustavsson
When debugging, it is important that we can trust the Core Erlang pretty printer and Core Erlang parser.
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-24Fix compile:forms/1,2 crash when not in an existing directoryBjörn Gustavsson
compile:forms/1,2 will crash when the current working directory has been deleted. Fix that problem, and while we are at it, also stop including {source,""} in module_info() when no source code file is given. Reported-at: http://bugs.erlang.org/browse/ERL-113 Reported-by: Adam Lindberg
2016-03-17compile: Pre-load compiler modules when invoked from 'erlc'Björn Gustavsson
Slightly speed up 'erlc' by pre-loading the modules used by the compiler. Write a test case to ensure that the correct set of modules are loaded.
2016-03-15update copyright-yearHenrik Nord
2016-02-25Remove ?line macrosBjörn Gustavsson
2016-02-25Replace use of lists:keysearch/3 with lists:keyfind/3Björn Gustavsson
2016-02-25Replace ?t with test_serverBjörn Gustavsson
The macro ?t is deprecated. Replace its use with 'test_server'.
2016-02-25Eliminate use of test_server:fail/0,1Björn Gustavsson
2016-02-25Eliminate use of ?config() macroBjörn Gustavsson
?config is ugly and not recommended. Use proplists:get_value/2 instead.
2016-02-25Modernize use of timetrapsBjörn Gustavsson
Either rely on the default 30 minutes timetrap, or set the timeout using the supported methods in common_test.
2016-02-17Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson
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.
2016-02-05Move record compilation errors to erl_lint_SUITEBjörn Gustavsson
The two bad record usage test cases in compile_SUITE do not belong there, as the errors are detected in erl_lint. Move the test to the erl_lint_SUITE.
2016-02-05compile_SUITE: Use get_files/3 in more placesBjörn Gustavsson
2016-02-05compile_SUITE: Replace confusing files/2 with get_files/3Björn Gustavsson
The files/2 function is confusing. The second argument names the output directory, not the name of the source module. It is common trap to attempt to point a different source file using files/2. Introduce the new get_files/3 which explicitly names the module name.
2015-09-28Move out bit syntax optimizations from beam_blockBjörn Gustavsson
In the future we might want to add more bit syntax optimizations, but beam_block is already sufficiently complicated. Therefore, move the bit syntax optimizations out of beam_block into a separate compiler pass called beam_bs.
2015-09-10compile_SUITE: Add test of warningsBjörn Gustavsson
Make sure that all warnings produced when compiling the test suite contains filenames and line numbers.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-04-30compiler: Use module erl_annoHans Bolinder
2015-04-22compile: Add the {eprof,Pass} option for easy eprof runningBjörn Gustavsson
To run eprof for a compiler pass: erlc +'{eprof,beam_asm}' file.erl The name of the compiler pass is the name as printed when 'time' option is used. It is usually, but not always, the module name for the compiler pass.
2015-01-27Strengthen and modernize compile_SUITEBjörn Gustavsson
When we compile from Core Erlang, do it with and without Core Erlang optimizations to ensure that we are not dependent on the optimizations always being run.
2015-01-16compile_SUITE: Test the 'dialyzer' optionBjörn Gustavsson
Cover more code in v3_core.
2014-08-14compiler: finalize 18.x 'asm' deprecationTuncer Ayaz
'asm' was deprecated in 18315c16, to be removed in 18.x.
2014-02-24Add test suites performing app and appup file checksTobias Schlager
Add the mentioned test suites for *all* library and touched non-library applications.
2014-01-31compiler: Strengthen listings testsBjörn-Egil Dahlberg
2014-01-28compiler: Test Maps inliningBjörn-Egil Dahlberg
2013-12-18Officially support building assembler filesTuncer Ayaz
erlc is wired to treat *.S files as assembler and build them as compile:file(File, [from_asm]), but this is not documented. There's also a documented compile:file/2 option called 'asm' (mapping to 'from_asm'), but the wording discourages its use. All of this has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * un-document 'asm' and document 'from_asm' instead * deprecate 'asm' While at it, fix a minor typo in the test suite.
2013-12-13Test compilation of BEAM assembly with optimisations onAnthony Ramine
2013-09-09Merge branch 'maint'Björn Gustavsson
* maint: compiler: Conform returned errors to the documented format
2013-09-05compiler: Conform returned errors to the documented formatBjörn Gustavsson
ErrorInfo is documented to be: {ErrorLine,Module,ErrorDescriptor} but for some errors with line numbers it would look like: {Module,ErrorDescriptor} Ensure that all ErrorInfo tuples have three elements. Use 'none' instead of a line number: {none,Module,ErrorDescriptor} There already are errors that return 'none' when no line number is available, but that convention was not documented. Mention it in the documentation. Also make sure that the compiler will not print 'none' as a line number in error messages (if the 'report_errors' option is given) as that looks stupid. That is, when attempting to compile a non-existing module, the error message should be: non-existing.erl: no such file or directory and not: non-existing.erl:none: no such file or directory
2013-06-12Update copyright yearsBjörn-Egil Dahlberg
2013-05-28Merge remote-tracking branch 'upstream/maint'Ingela Anderton Andin
Conflicts: bootstrap/lib/stdlib/ebin/beam_lib.beam lib/public_key/test/erl_make_certs.erl
2013-05-20beam_lib, compile: Replace use of deprecated crypto functionsBjörn Gustavsson
Since both the STDLIB and compiler applications turn warnings into errors, we must stop using the old deprecated crypto functions. While we are at it, generalize the format of the key tuple returned by beam_lib:make_crypto_key/2 to facilitate introducing new crypto methods in the future. Change the format to: {Type,Key,IV,BlockSize} where Type, Key, and IV are the first three arguments for either crypto:block_encrypt4/ or crypto:block_decrypt/4, and BlockSize is the block size for the crypto algorithm (it is needed to properly pad the plaintext blocks before encryption).
2013-04-19Remove the "coding: utf-8" comment from all Erlang source filesHans Bolinder
2013-01-09compiler: Remove support for packagesBjörn Gustavsson
2012-08-24Merge branch 'rc/fix-MP-compiler-flag/OTP-10211' into maintFredrik Gustafsson
2012-08-06compiler: Eliminate EXIT messages from the temporary compiler processBjörn Gustavsson
If a process trap exits, calling the compiler would leave an EXIT message in the message queue of the calling process because the compiler spawns a temporary work process. Eliminate the EXIT process by monitoring the temporary process instead of linking to it. Reported-by: Jeremy Heater
2012-08-06compile_SUITE: Correct the forms_2 test case to work on WindowsBjörn Gustavsson
Correct the forms_2 test case introduced in 2d785c07fbf9f533bf so that it will work on Windows. As originally written, the test case assumed that filename:absname("/foo/bar") would return "/foo/bar", which is not true on Windows (typically, the result will be "c:/foo/bar"). While at it, clean up indentation, the overlong line, and comments.
2012-07-10Fix the erlc -MP flagRichard Carlsson
Because of a copy-and-paste error in erlc.c, the -MP flag had the same effect as -MG. As a workaround, you had to pass +makedep_phony to enable the MP option. This patch makes -MP work as intended.
2012-04-10Allow the source to be set when compiling formsJosé Valim
This commit adds a source option to compile:forms() that sets the source value returned by module_info(compile).
2012-03-30Update copyright yearsBjörn-Egil Dahlberg
2012-01-25compile_SUITE: Eliminate race conditionBjörn Gustavsson
Compiling the same source code with the same options may not produce the same BEAM file because the compilation time is included in the "CInf" chunk.
2012-01-11compile_SUITE: Add test of 'sys_pre_attributes'Björn Gustavsson
2011-11-24compiler: Don't include source code options in module_info(compile)Björn Gustavsson
As far as I know, the purpose of the compiler options included in Mod:module_info(compile) has never been documented. An educated guess is that they are there in case you want to re-compile the module with the same options, and also to aid in debugging when you need to know how a module was compiled. In neither case is there any need to include options given in the source itself in options included in Mod:module_info(compile). Including those options will only waste memory. Therefore, only include in the BEAM file the options that were given to compile:file/2.
2011-11-24hipe: Teach hipe to handle slim or stripped BEAM filesBjörn Gustavsson