mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 03:43:51 +00:00
compiler/options.m:
doc/user_guide.texi:
Add a new developer-only option, --std-int-file-not-written-msgs,
which, if specified, calls for the "file not written" messages
we generate when we want to write interface files but can't
to be written out in a standard form that deletes the directory
path component from the names of the files not written out.
In the long term, it is less work to add this option once
than to add a separate .err_exp file for each affected test case.
compiler/write_module_interface_files.m:
Obey the new option.
tests/invalid/ee_invalid.m:
Add C# and Java foreign_types next to the C foreign_type.
tests/invalid/erroneous_throw_promise.m:
Add C# foreign_procs next to the C and Java foreign_procs.
tests/invalid/exist_foreign_error.m:
Add C# and Java foreign_procs next to a C foreign_proc.
tests/invalid/exist_foreign_error.err_exp:
tests/invalid/exist_foreign_error.err_exp2:
tests/invalid/exist_foreign_error.err_exp3:
Update the line number in the expected error output file for C,
and add expected error output files for Java and C#.
tests/invalid_make_int/bug17.{m,int_err_exp}:
tests/invalid_make_int/builtin_int.{m,int_err_exp}:
Move these test cases here from tests/invalid, since all the errors
we test for are reported when making the .int file.
tests/invalid/Mmakefile:
Delete the tests moved to tests/invalid_make_int.
tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
Add the tests moved from tests/invalid. Specify the new option
for all the test cases.
84 lines
2.4 KiB
Mathematica
84 lines
2.4 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% Test error messages for invalid foreign_export_enum pragmas.
|
|
%
|
|
:- module ee_invalid.
|
|
:- interface.
|
|
|
|
:- type foo(T)
|
|
---> foo(T).
|
|
|
|
:- type bar == int.
|
|
|
|
:- implementation.
|
|
:- type baz
|
|
---> baz.
|
|
:- pragma foreign_type("C", baz, "int").
|
|
:- pragma foreign_type("Java", baz, "int").
|
|
:- pragma foreign_type("C#", baz, "int").
|
|
:- type alphabet
|
|
---> abc
|
|
; def
|
|
; ghi
|
|
; jkl
|
|
; mno
|
|
; pqr
|
|
; stu
|
|
; vwx
|
|
; yz.
|
|
|
|
:- type strange_names
|
|
---> '!@THIS'
|
|
; '#$WON''T'
|
|
; '%^WORK'.
|
|
|
|
% foreign_export_enum pragma for atomic type.
|
|
%
|
|
:- pragma foreign_export_enum("C", int/0).
|
|
|
|
% foreign export_enum pragma for undefined type.
|
|
%
|
|
:- pragma foreign_export_enum("C", undefined_type/0).
|
|
|
|
% foreign_export_enum pragma for non-enumeration d.u. type.
|
|
%
|
|
:- pragma foreign_export_enum("C", foo/1).
|
|
|
|
% foreign_export_enum pragma for equivalence type.
|
|
%
|
|
:- pragma foreign_export_enum("C", bar/0).
|
|
|
|
% foreign_export_enum pragma for foreign_type (with default
|
|
% Mercury definition.)
|
|
% We should reject these if the language of the foreign_type
|
|
% and foreign_export_enum pragmas is the same.
|
|
%
|
|
:- pragma foreign_export_enum("C", baz/0).
|
|
|
|
% foreign_export_enum pragma where the override list refers to a
|
|
% constructor that is not a member of the type.
|
|
%
|
|
:- pragma foreign_export_enum("C", alphabet/0,
|
|
[], [abc - "ABC", deg - "DEF"]).
|
|
|
|
% Make sure we do something sensible with module-qualifiers
|
|
% in the override list.
|
|
:- pragma foreign_export_enum("C", alphabet/0,
|
|
[], [ee_invalid.abc - "ABC", foo.def - "DEF"]).
|
|
|
|
% Check that the the mappings from Mercury -> Foreign names are a bijection.
|
|
%
|
|
:- pragma foreign_export_enum("C", alphabet/0,
|
|
[prefix("FOO")], [abc - "ABC", deg - "ABC"]).
|
|
:- pragma foreign_export_enum("C", alphabet/0,
|
|
[prefix("BAR")], [def - "abc"]).
|
|
:- pragma foreign_export_enum("C", alphabet/0,
|
|
[prefix("BAZ")], [abc - "ABC", abc - "DEF"]).
|
|
|
|
% Emit an error when the default mapping for a language fails and
|
|
% the user has not specified an alternative.
|
|
%
|
|
:- pragma foreign_export_enum("C", strange_names/0).
|