Files
mercury/tests/invalid/state_vars_test1.m
Zoltan Somogyi 3dc4babb24 Update the style of more test cases.
And update expected output files for changes in line numbers.
2021-07-27 13:29:46 +10:00

24 lines
494 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ft=mercury ff=unix ts=4 sw=4 et
%---------------------------------------------------------------------------%
:- module state_vars_test1.
:- interface.
:- pred p(int::in, int::out) is det.
:- implementation.
:- import_module int.
% Illegally refers to !:X in an if-then-else expr.
%
p(!X) :-
!:X = !.X +
( if max(0, !.X, !:X) then
1
else
2
).