mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 05:13:48 +00:00
Estimated hours taken: 0.8
tests/hard_coded/space.{m,out}:
Use our own random number generator, since the output of random.m
depends on the wordsize of the machine.
tests/hard_coded/no_inline.{m,out}:
Use a more direct test of whether the C code is inlined or not.
34 lines
408 B
Mathematica
34 lines
408 B
Mathematica
|
|
:- module no_inline.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
|
|
main -->
|
|
{
|
|
bar(A),
|
|
bar(B),
|
|
bar(C),
|
|
bar(D)
|
|
},
|
|
io__write([A, B, C, D]),
|
|
io__write_string("\n").
|
|
|
|
:- pragma no_inline(bar/1).
|
|
:- pred bar(int::out) is det.
|
|
|
|
:- pragma c_code(bar(Value::out), "
|
|
{
|
|
static int counter = 0;
|
|
|
|
Value = counter++;
|
|
}
|
|
").
|