mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 08:14:31 +00:00
tests/valid/int64.m:
Rename this test case to unescaped_special_char since its current name
conflicts with an upcoming standard library addition. The new name
is more descriptive anyway.
Rename the type int64/0 defined in this test since an upcoming change
will make that type a builtin (and hence a reserved name).
tests/valid/Mmakefile:
Conform to the above change.
30 lines
726 B
Mathematica
30 lines
726 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% A development version of the Mercury compiler generated invalid C code
|
|
% for this example, because it didn't properly escape special characters
|
|
% such as \ in some of the C strings that it generated.
|
|
|
|
:- module unescaped_special_char.
|
|
|
|
:- interface.
|
|
|
|
:- type myint64.
|
|
|
|
:- func myint64 /\ myint64 = myint64.
|
|
|
|
:- implementation.
|
|
|
|
:- type myint64 == int.
|
|
|
|
:- pragma foreign_proc("C",
|
|
(A::in) /\ (B::in) = (C::out),
|
|
[promise_pure, will_not_call_mercury],
|
|
"
|
|
C = A & B;
|
|
").
|
|
|
|
% implementation for the other backends.
|
|
A /\ _B = A.
|