Files
mercury/tests/hard_coded/c_write_string.m
Zoltan Somogyi 06886b3450 A new test to confirm the absence of a bug reported by Tim Barbour a while ago.
Estimated hours taken: 0.2

A new test to confirm the absence of a bug reported by Tim Barbour a while ago.
1996-07-20 10:52:58 +00:00

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" }.