Files
mercury/tests/hard_coded/pragma_inline.m
Tyson Dowd 630c98c8f1 Remove support for term_to_type and type_to_term implemented as special
Estimated hours taken: 5

Remove support for term_to_type and type_to_term implemented as special
preds.  Remove support for one-cell and one-or-two-cell type_infos (now
shared-one-or-two-cell type_infos). Move definitions that were in
mercury_builtin.m back to where they belong.

This code has been removed because it is no longer used, and was no
longer being maintained but was still quite complex.

tests/general/disj_disj.m:
tests/general/dnf.m:
tests/general/higher_order.m:
tests/general/nondet_disj.m:
tests/hard_coded/cc_nondet_disj.m:
tests/hard_coded/pragma_inline.m:
tests/invalid/funcs_as_preds.err_exp:
tests/misc_tests/mdemangle_test.exp:
tests/valid/agc_unbound_typevars.m:
tests/valid/middle_rec_labels.m:
tests/valid/subtype_switch.m:
tests/warnings/infinite_recursion.m:
	Import module `list' or `term' (or both).
1997-05-20 02:09:15 +00:00

47 lines
1.0 KiB
Mathematica

% A test of the pragma(inline, ...) declarations.
:- module pragma_inline.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module list, string.
main -->
{ L = "l"},
{ append_strings(L, L, LL) },
{ string__append_list(["He", LL, "o, world\n"], String) },
c_write_string(String).
:- pragma(c_header_code, "#include <stdio.h>").
:- pred c_write_string(string::in, io__state::di, io__state::uo) is det.
:- pragma(c_code, c_write_string(Message::in, IO0::di, IO::uo),
will_not_call_mercury, "
printf(""%s"", Message);
IO = IO0;
").
:- pragma(inline, c_write_string/3).
:- pred append_strings(string::in, string::in, string::out) is det.
:- pragma inline(append_strings/3).
:- pragma c_code(append_strings(S1::in, S2::in, S3::out),
will_not_call_mercury, "{
size_t len_1, len_2;
Word tmp;
len_1 = strlen(S1);
len_2 = strlen(S2);
incr_hp_atomic(tmp, (len_1 + len_2 + sizeof(Word)) / sizeof(Word));
S3 = (char *) tmp;
strcpy(S3, S1);
strcpy(S3 + len_1, S2);
}").