mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 16:24:43 +00:00
Estimated hours taken: 0.25 Branches: main tests/hard_coded/intermod_pragma_clause.exp: tests/hard_coded/intermod_pragma_clause.m: tests/hard_coded/intermod_pragma_clause_sub.m: Test that intermodule optimization works when clauses are defined as both a foreign proc and a mercury clause.
26 lines
468 B
Mathematica
26 lines
468 B
Mathematica
% A regression test to ensure that we don't get warnings about the variables
|
|
% _IO0 and _IO occuring more than once.
|
|
:- module no_warn_singleton.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
main -->
|
|
f(X),
|
|
io__write_int(X),
|
|
io__nl.
|
|
|
|
:- pred f(int::out, io::di, io::uo) is det.
|
|
|
|
:- pragma foreign_proc("C", f(X::out, _IO0::di, _IO::uo),
|
|
[will_not_call_mercury, promise_pure], "
|
|
X = 5;
|
|
").
|
|
|
|
f(5) --> [].
|