% gcc_warn
% Author: Matt Giuca
% Demonstration for Mercury bug that produces GCC "used but never defined"
% warnings.

:- module gcc_warn.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.

:- implementation.
:- import_module int.

:- pred add(int::in, int::in, int::out) is det.
add(X, Y, Z) :-
    Z = X + Y.

:- func add_wrap(int, int) = int.
add_wrap(X, Y) = Z :-
    add(X)(Y, Z).

main(!IO) :-
    io.write(add_wrap(1, 2), !IO),
    io.nl(!IO).
