mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +00:00
tests/invalid/Mmakefile:
Add type_error_use_module to list of REDIRECT_OPT_ERROR_MODULES
as it produces error messages while making the .opt file.
tests/invalid/multiply_star.m:
Add description of .err_exp files.
tests/invalid/multiply_star.err_exp:
Update line numbers.
tests/invalid/multiply_star.err_exp2:
Add expected error output when compiling with intermodule
optimisation.
24 lines
568 B
Mathematica
24 lines
568 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% The .exp file file is for compiling without intermodule optimization.
|
|
% The .err_exp2 file is for compiling with intermodule optimization.
|
|
|
|
:- module multiply_star.
|
|
|
|
:- interface.
|
|
|
|
:- pred p(int::in, int::out) is det.
|
|
|
|
:- implementation.
|
|
|
|
% :- import_module int. % This import is missing.
|
|
|
|
p(A, Z) :-
|
|
( if A = 0 then
|
|
Z = 1
|
|
else
|
|
Z = A * 2
|
|
).
|