mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 12:26:29 +00:00
Add regression test for a bug introduced in commitf6e2290031and fixed in commit53e73a9e95tests/hard_coded/Mmakefile: tests/hard_coded/static_term_bug.m: tests/hard_coded/static_term_bug.exp: Add new test.
41 lines
874 B
Mathematica
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)).
|