Files
mercury/tests/invalid/multimode_missing_impure.m
Fergus Henderson ce7a41620d Add some test cases for my recent change to add support
Estimated hours taken: 2
Branches: main

tests/hard_coded/Mmakefile:
tests/hard_coded/multimode.m:
tests/hard_coded/multimode.exp:
tests/invalid/Mmakefile:
tests/invalid/multimode_missing_impure.m:
tests/invalid/multimode_missing_impure.err_exp:
tests/invalid/multimode_dcg.m:
tests/invalid/multimode_dcg.err_exp:
tests/invalid/multimode_syntax.m:
tests/invalid/multimode_syntax.err_exp:
	Add some test cases for my recent change to add support
	for using different clauses for different modes.
2001-05-16 17:28:43 +00:00

50 lines
1.0 KiB
Mathematica

:- module multimode_missing_impure.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
main -->
{ In = 42 },
{ test0 },
{ test1(In) },
{ test1(_Out0) },
{ test2(In, In) },
{ test2(In, _Out1) },
{ test2(_Out2, In) },
{ test2(_Out3, _Out4) }.
:- pred test0.
:- mode test0 is det.
test0 :-
puts("test0").
% This should be declared impure, or promise pure
:- pred test1(int).
:- mode test1(in) is det.
:- mode test1(out) is det.
test1(_::in) :-
puts("test1(in)").
test1(0::out) :-
puts("test1(out)").
% This should be declared impure, or promise pure
:- pred test2(int, int).
:- mode test2(in, in) is det.
:- mode test2(in, out) is det.
:- mode test2(out, in) is det.
:- mode test2(out, out) is det.
test2(_::in, _::in) :-
puts("test2(in, in)").
test2(_::in, 0::out) :-
puts("test2(in, out)").
test2(0::out, _::in) :-
puts("test2(out, in)").
test2(0::out, 0::out) :-
puts("test2(out, out)").
:- pred puts(string::in) is det.
:- pragma c_code(puts(S::in), [will_not_call_mercury], "puts(S)").