Files
mercury/tests/invalid_nodepend/bad_mutable.m
Zoltan Somogyi 6413b4fb08 Create invalid_nodepend and invalid_onlydepend.
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.
2021-07-28 00:59:04 +10:00

53 lines
1.6 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module bad_mutable.
:- interface.
:- mutable(in_interface, int, 0, ground, [untrailed]).
:- type export_something == int.
:- implementation.
:- type list(T)
---> []
; [T | list(T)].
:- mutable(not_a_type, no_type, 0, ground, [untrailed]).
% XXX We should get one error message for this, not two.
:- mutable(not_an_inst, int, 0, special_ground, [untrailed]).
:- mutable(bad_attribute, int, 0, ground, [untrailed, bad_attrib]).
:- mutable(poly_type, list(T), [], ground, [untrailed]).
:- mutable(conflicting_trail, int, 0, ground, [untrailed, trailed]).
:- mutable(multiple_foreign, int, 0, ground,
[untrailed, foreign_name("C", "one"), foreign_name("C", "two")]).
:- mutable(conflicting_thr_local1, int, 0, ground, [thread_local, trailed]).
:- mutable(conflicting_thr_local2, int, 0, ground, [thread_local, constant]).
:- type t1
---> f1(int, int).
:- inst t1
---> f1(ground, unique).
:- mutable(non_ground, t1, f1(41, 43), t1, [untrailed]).
:- mutable(non_list_attr, int, 0, ground, thread_local).
:- mutable(conflict_trailed_constant, int, 0, ground, [trailed, constant]).
:- mutable(repeated_untrailed, int, 0, ground, [untrailed, untrailed]).
:- mutable(repeated_constant, int, 0, ground,
[constant,
constant, constant, % There should be one error for these two repeats ...
constant]). % ... and one error for this one repeat.
:- mutable(implicitly_untrailed, int, 0, ground, [thread_local]).