mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
tests/general/float_test.exp3:
tests/general/float_test.m:
tests/general/read_dir_regression.exp4:
tests/general/read_dir_regression.m:
tests/hard_coded/remove_file.exp2:
tests/hard_coded/remove_file.m:
Delete Erlang backend specific expected outputs.
tests/hard_coded/Mmakefile:
tests/hard_coded/erlang_deconstruct.exp:
tests/hard_coded/erlang_deconstruct.m:
tests/hard_coded/existential_list.exp:
tests/hard_coded/existential_list.m:
tests/valid/Mmakefile:
tests/valid/erl_ite_vars.m:
tests/valid/zf_erlang_bug.m:
Delete erlang target specific tests.
tests/*:
Delete Erlang foreign procs and foreign types.
61 lines
1003 B
Mathematica
61 lines
1003 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
|
|
:- module no_inline.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
|
|
:- pragma promise_pure(main/2).
|
|
main(!IO) :-
|
|
impure bar(A),
|
|
impure bar(B),
|
|
impure bar(C),
|
|
impure bar(D),
|
|
io.write_line([A, B, C, D], !IO).
|
|
|
|
:- pragma no_inline(bar/1).
|
|
:- impure pred bar(int::out) is det.
|
|
|
|
:- pragma foreign_proc("C",
|
|
bar(Value::out),
|
|
[will_not_call_mercury],
|
|
"
|
|
{
|
|
static int counter = 0;
|
|
|
|
Value = counter++;
|
|
}
|
|
").
|
|
|
|
:- pragma foreign_code("C#",
|
|
"
|
|
static int counter = 0;
|
|
").
|
|
:- pragma foreign_proc("C#",
|
|
bar(Value::out),
|
|
[],
|
|
"
|
|
Value = counter++;
|
|
").
|
|
|
|
:- pragma foreign_code("Java",
|
|
"
|
|
static int counter = 0;
|
|
").
|
|
:- pragma foreign_proc("Java",
|
|
bar(Value::out),
|
|
[],
|
|
"
|
|
Value = counter++;
|
|
").
|