diff options
author | Björn Gustavsson <[email protected]> | 2017-11-13 12:58:04 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-11-13 13:11:37 +0100 |
commit | 8059d34e52587880b0bbb6eb2845e6a46cb19d21 (patch) | |
tree | c14b5cb1cdf470ac073143d09ace2250a88ec9d4 /lib/compiler/test | |
parent | 743e5a4d6b71317672e2527b0ab77ec45d91aac9 (diff) | |
parent | cde4ddc0494c9cdc8169dbc552e0e9b91c3a1b30 (diff) | |
download | otp-8059d34e52587880b0bbb6eb2845e6a46cb19d21.tar.gz otp-8059d34e52587880b0bbb6eb2845e6a46cb19d21.tar.bz2 otp-8059d34e52587880b0bbb6eb2845e6a46cb19d21.zip |
Merge branch 'maint'
* maint:
Recognize 'deterministic' when given in a -compile() attribute
Conflicts:
lib/compiler/src/beam_asm.erl
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/compile_SUITE.erl | 10 | ||||
-rw-r--r-- | lib/compiler/test/compile_SUITE_data/deterministic_module.erl | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index 46b955b1f8..8fe2a93f95 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -120,9 +120,19 @@ file_1(Config) when is_list(Config) -> true = exists(Target), passed = run(Target, test, []), + %% Test option 'deterministic' as a compiler attribute. + Det = deterministic_module, + {DetPath, DetTarget} = get_files(Config, Det, "det_target"), + {ok,Det,DetCode} = compile:file(DetPath, [binary]), + {module,Det} = code:load_binary(Det, "", DetCode), + [{version,_}] = Det:module_info(compile), + true = code:delete(Det), + false = code:purge(Det), + %% Cleanup. ok = file:delete(Target), ok = file:del_dir(filename:dirname(Target)), + ok = file:del_dir(filename:dirname(DetTarget)), %% There should not be any messages in the messages. receive diff --git a/lib/compiler/test/compile_SUITE_data/deterministic_module.erl b/lib/compiler/test/compile_SUITE_data/deterministic_module.erl new file mode 100644 index 0000000000..5e0e29c25e --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/deterministic_module.erl @@ -0,0 +1,21 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2017. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%% +%% %CopyrightEnd% +%% +-module(deterministic_module). +-compile([deterministic]). |