Files
mercury/tests/valid/intermod_nested_module.m
Simon Taylor 8028192a5b Fix two bugs in intermodule optimization reported by Warwick Harvey.
Estimated hours taken: 2

Fix two bugs in intermodule optimization reported by Warwick Harvey.

compiler/intermod.m:
	Don't read `.opt' files for nested modules. The compiler
	currently doesn't read in the `.int0' files for parent modules
	of modules for which `.opt' files are read, resulting in
	undefined symbol errors.

	Export predicate `update_error_status' for use by trans_opt.m.

compiler/trans_opt.m:
	Use intermod__update_error_status to check whether an
	error should be reported if a `.trans_opt' file is not found.
	This is difficult to write a test case for because it would
	be spread across multiple directories.

compiler/options.m:
doc/user_guide.texi:
	Add option --warn-missing-trans-opt-files.

compiler/handle_options:
	--check-termination implies --warn-missing-trans-opt-files.

tests/valid/Mmakefile:
tests/valid/intermod_nested_module.m:
tests/valid/intermod_nested_module2.m:
	Test case.
1999-11-14 02:29:22 +00:00

24 lines
544 B
Mathematica

% Check that inter-module optimization works with nested modules.
%
% The compiler of 12/11/1999 did not read the `.int0' files
% for parent modules of a module for which a `.opt' file was
% read, resulting in undefined symbol errors.
:- module intermod_nested_module.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module int.
:- import_module intermod_nested_module2, intermod_nested_module2__sub_module.
main -->
{ bar(3, X) },
write(X),
nl.