mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 10:23:46 +00:00
Estimated hours taken: 0.2 A new test to confirm the absence of a bug reported by Tim Barbour a while ago.
23 lines
497 B
Mathematica
23 lines
497 B
Mathematica
:- module c_write_string.
|
|
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- pred c_write_string(string, io__state, io__state).
|
|
:- mode c_write_string(in, di, uo) is det.
|
|
|
|
:- pragma(c_header_code, "#include <stdio.h>").
|
|
|
|
:- pragma(c_code, c_write_string(Str::in, IO0::di, IO::uo),
|
|
"fputs(Str, stdout); IO = IO0;").
|
|
|
|
main -->
|
|
c_write_string("Hello, world\n"),
|
|
c_write_string("I am 8 today!\n"),
|
|
c_write_string(X),
|
|
{ X = "fred\n" }.
|