Files
mercury/tests/debugger/loopcheck.m
Zoltan Somogyi a822f78b3c Add meaningful contexts to the goals inserted into predicates by tabling,
Estimated hours taken: 4

Add meaningful contexts to the goals inserted into predicates by tabling,
for use by the debugger.

compiler/table_gen.m:
	Pass the context of the procedure body through the code, and create
	new goals with this context.

	To make this simpler, switch to consistently using combined predmode
	definitions. In a couple of places, switch to a more reasonable
	argument ordering.

tests/debugger/loopcheck.*
	Copy this test case here from the tabling directory, and execute it
	under mdb, as a regression test.

	The exp2 test case is not final yet.

tests/debugger/Mmakefile:
	Enable the regression test.
1999-12-21 01:23:44 +00:00

22 lines
452 B
Mathematica

% Regression test, for making sure that tabling inserts meaningful contexts
% into the goal_infos of the goals it inserts into procedure bodies, for use
% by the debugger.
:- module loopcheck.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
main -->
{ loop(10) },
io__write_string("Hello, world\n").
:- pragma loop_check(loop/1).
:- pred loop(int::in) is erroneous.
loop(X) :-
loop(X).