Files
mercury/tests/valid/intermod_user_sharing.m
Peter Wang 8fd6601ec7 Write out user-specified structure sharing annotations
Estimated hours taken: 2.5
Branches: main

Write out user-specified structure sharing annotations
(no_sharing/unknown_sharing/sharing) on foreign_procs, e.g. when making `.opt'
files.

compiler/prog_data.m:
	Move `attributes_to_strings' to mercury_to_mercury.m and rename it to
	less ambiguous `foreign_proc_attributes_to_strings'.  This is to avoid
	a circular dependency.

	Add a comment that adding a field to `pragma_foreign_proc_attributes'
	requires updating `foreign_proc_attributes_to_strings'.

compiler/mercury_to_mercury.m:
	Make `foreign_proc_attributes_to_strings' take into account user
	sharing annotations.

tests/valid/Mercury.options:
tests/valid/Mmakefile:
tests/valid/intermod_user_sharing.m:
tests/valid/intermod_user_sharing_2.m:
	Add a test case.
2008-03-04 00:36:06 +00:00

30 lines
834 B
Mathematica

% Test that we can write out and read back in `no_sharing', `unknown_sharing'
% and `sharing' annotations on foreign_procs.
:- module intermod_user_sharing.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- implementation.
:- import_module intermod_user_sharing_2.
:- import_module io.
%-----------------------------------------------------------------------------%
main(!IO) :-
p_no_sharing(!IO),
p_unknown_sharing("bar", Bar),
io.write(Bar, !IO),
p_sharing(1, "foo", Array),
io.write(Array, !IO).
%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=8 sw=4 et wm=0 tw=0