Files
mercury/tests/valid/deforest_rerun_det.m
Zoltan Somogyi c03b11ca48 Update the style of more test cases.
And updated expected outputs for changed line numbers.
2021-07-27 19:29:21 +10:00

41 lines
890 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% This is a regression test for an abort during deforestation caused
% by det_analysis looking at an out-of-date map(var, type).
:- module deforest_rerun_det.
:- interface.
:- import_module int.
:- pred bug(int::in, int::in, int::out) is semidet.
:- implementation.
bug(Int1, Int2, Result) :-
compare_int(Int1, Int2, Res),
(
Res = (<),
Result = Int1
;
Res = (=),
fail
;
Res = (>),
Result = Int2
).
:- pred compare_int(int::in, int::in, comparison_result::out) is det.
compare_int(Int1, Int2, Res) :-
( if Int1 < Int2 then
Res = (<)
else if Int1 = Int2 then
Res = (=)
else
Res = (>)
).