Files
mercury/tests/invalid/invalid_export_detism.m
Julien Fischer 51b3ce2bab Catch errors concerning pragma export and model_non code
Estimated hours taken: 3
Branches: main

Catch errors concerning pragma export and model_non code
earlier than we do at the moment.  Currently, we just generate
#error directives in the C code and let the C preprocessor
report the error.

compiler/make_hlds.m:
	Emit an error message if pragma export is used on a
	procedure that has a declared determinism of multi
	or nondet.

compiler/det_analysis.m:
compiler/det_report.m:
	As above, but handle the case where the determinism
	needs to be inferred.

compiler/export.m:
	Abort rather than trying to generate code for model_non
	pragma exports.

tests/invalid/Mmakefile:
tests/invalid/invalid_export_detism.err_exp:
tests/invalid/invalid_export_detism.m:
	Test case for the above.
2005-01-06 04:30:55 +00:00

17 lines
217 B
Mathematica

:- module invalid_export_detism.
:- interface.
:- pred foo(int::in, int::out) is nondet.
:- implementation.
:- pragma export(foo(in, out), "EXPORTED_FOO").
foo(1, 2).
foo(2, 3).
foo(3, 4).
foo(3, 5).
foo(3, 6).