Files
mercury/tests/valid/intermod_nested_module2.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

31 lines
362 B
Mathematica

:- module intermod_nested_module2.
:- interface.
:- type foo.
:- module sub_module.
:- interface.
:- import_module int.
:- pred bar(int, foo).
:- mode bar(in, out) is det.
:- end_module sub_module.
:- implementation.
:- type foo ---> foo(int).
:- module sub_module.
:- implementation.
bar(X, foo(Y)) :-
Y = X + 1.
:- end_module sub_module.