Files
mercury/tests/hard_coded/static_term_bug.m
Peter Wang 45ba4d0488 Add regression test.
Add regression test for a bug introduced in
commit f6e2290031
and fixed in
commit 53e73a9e95

tests/hard_coded/Mmakefile:
tests/hard_coded/static_term_bug.m:
tests/hard_coded/static_term_bug.exp:
    Add new test.
2018-07-27 17:55:38 +10:00

41 lines
874 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module static_term_bug.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%---------------------------------------------------------------------------%
:- implementation.
:- type data
---> none
; data(data_info).
:- type data_info
---> data_info(side, int).
:- type side
---> top
; bottom.
main(!IO) :-
( if get_data("top", Data) then
io.write(Data, !IO),
io.nl(!IO)
else
io.write_string("failed\n", !IO)
).
:- pred get_data(string::in, data::out) is semidet.
:- pragma no_inline(get_data/2).
get_data(Side, Data) :-
Side = "top",
Data = data(data_info(top, 1234)).