Files
mercury/tests/declarative_debugger/remember_modes.m
Zoltan Somogyi ecb5e4a9e6 Update the style of many test cases.
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
    Update programming style.

tests/declarative_debugger/*.inp:
    Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
    Update expected line numbers.

tests/exceptions/Mercury.options:
tests/general/Mercury.options:
    Disable some warnings that are irrelevant to the test.
2021-07-25 23:26:17 +10:00

43 lines
874 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module remember_modes.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module int.
:- import_module list.
:- pred p(int, int).
:- mode p(in, in) is semidet.
:- mode p(in, out) is semidet.
:- mode p(out, in) is semidet.
:- mode p(out, out) is det.
p(1, 2).
:- pred q(int::in, int::out, int::out, int::out, int::out) is semidet.
q(V, W, X, Y, Z) :-
p(V, 2),
p(W, 2),
p(1, X),
p(Y, Z).
main(!IO) :-
( if q(1, W, X, Y, Z) then
io.write_line(W, !IO),
io.write_line(X, !IO),
io.write_line(Y, !IO),
io.write_line(Z, !IO)
else
write_string("failed\n", !IO)
).