mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 11:54:02 +00:00
tests/invalid_onlydepend:
Move the one test case in tests/invalid for which we want to check
the error messages generated during the generation of dependencies
to this new test directory.
tests/invalid_nodepend:
Move all test cases in tests/invalid which get errors during the
generation of dependencies but for which we want to check the error
messages generated during normal compilation to this new test directory.
tests/invalid_nodepend/Mmakefile:
tests/invalid_nodepend/Mercury.options:
tests/invalid_onlydepend/Mmakefile:
tests/invalid_onlydepend/Mercury.options:
Versions of the same files in tests/invalid, but containing only
the entries relevant to the moved test cases.
tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
Delete the entries that refer to the moved test cases.
tests/README:
Document the two new test directories.
tools/bootcheck:
Add invalid_onlydepend and invalid_nodepend to the list of
test directories.
47 lines
1.1 KiB
Mathematica
47 lines
1.1 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% Test for the error messages generated for syntax errror in 'foreign_export'
|
|
% pragmas.
|
|
|
|
:- module bad_foreign_export.
|
|
:- interface.
|
|
|
|
:- func foo(int, int) = int.
|
|
|
|
:- implementation.
|
|
:- import_module int.
|
|
|
|
foo(X, Y) = X + Y.
|
|
|
|
% Incorrect number of arguments.
|
|
%
|
|
:- pragma foreign_export("C").
|
|
|
|
% Second arg is not pred-and-modes.
|
|
%
|
|
:- pragma foreign_export("C", 11111, "Test2").
|
|
|
|
% Third arg is not a string.
|
|
%
|
|
:- pragma foreign_export("C", foo(in, in) = out, 22222).
|
|
|
|
% Invalid foreign laguage.
|
|
%
|
|
:- pragma foreign_export("InvalidLanguage", foo(in, in) = out, "Test4").
|
|
|
|
% Check that the contexts error messages for each argument are correct.
|
|
%
|
|
:- pragma foreign_export(
|
|
"InvalidLanguage",
|
|
3333,
|
|
4444
|
|
).
|
|
|
|
% Third arg is the empty string.
|
|
%
|
|
:- pragma foreign_export("C", foo(in, in) = out, "").
|
|
|
|
:- pragma foreign_export("Erlang", foo(in, in) = out, "xyzzy").
|