Files
mercury/tests/hard_coded/factt.m
Fergus Henderson 056e7b3eb3 Add a regression test to test three recently-fixed bugs
Estimated hours taken: 0.25

tests/hard_coded/Mmakefile:
tests/hard_coded/factt.m:
tests/hard_coded/factt_examples:
tests/hard_coded/factt.exp:
	Add a regression test to test three recently-fixed bugs
	related to fact tables:
		- duplicate C labels,
		- incorrect dependencies with --use-subdirs, and
		- undefined symbols due to passing the wrong arguments
		  to c2init.
1999-02-08 23:36:47 +00:00

34 lines
717 B
Mathematica

:- module factt.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module int.
:- pred example(int::in,int::out,int::out) is semidet.
:- pragma fact_table(example/3,"factt_examples").
:- pred show_examples(int::in,io__state::di, io__state::uo) is det.
main -->
show_examples(1).
show_examples(Num) -->
({example(Num,Result1,Result2)} ->
print(Num),print(" "),
print(Result2),print(" "),
print(Result1),nl;
print("Example call failed."),nl
),
{Num1 is Num + 1},
({Num1 < 51} ->
show_examples(Num1);
print("Finished"),nl
).