Files
mercury/tests/debugger/list_cmd.m
Peter Wang 7fec2d28a7 Add test for mdb 'list' external command.
tests/debugger/list_cmd.m:
tests/debugger/list_cmd.inp:
tests/debugger/list_cmd.exp:
tests/debugger/list_cmd.exp2:
    Add new test case.

tests/debugger/list_cmd.sh:
    Add script to be set as the 'list_cmd'.

tests/debugger/Mmakefile:
    Enable the new test.
2020-10-06 13:42:39 +11:00

37 lines
757 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% The .exp file is for platforms with posix_spawn.
% The .exp2 file is for platforms without posix_spawn.
%
%---------------------------------------------------------------------------%
:- module list_cmd.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module int.
main(!IO) :-
fib(5, N),
io.write_int(N, !IO),
io.nl(!IO).
:- pred fib(int::in, int::out) is det.
fib(N, F) :-
( if N < 2 then
F = 1
else
fib(N - 1, F1),
fib(N - 2, F2),
F = F1 + F2
).