[m-dev.] diff: MLDS back-end: fix `pragma export' bug

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 24 20:01:05 AEST 2000


On 24-Aug-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Fix a bug in the MLDS back-end: handle `pragma export' of procedures
> defined in modules other than the current module.

Probably a good idea to add a test for that...

----------

Estimated hours taken: 0.25

tests/hard_coded/Mmakefile:
tests/hard_coded/pragma_export.m:
tests/hard_coded/pragma_export.exp:
	A regression test for the above-mentioned bug fix.

Workspace: /home/pgrad/fjh/ws/hg
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.87
diff -u -d -r1.87 Mmakefile
--- tests/hard_coded/Mmakefile	2000/06/05 02:47:36	1.87
+++ tests/hard_coded/Mmakefile	2000/08/24 08:18:15
@@ -82,6 +82,7 @@
 	pragma_c_code \
 	pragma_inline \
 	pragma_import \
+	pragma_export \
 	qual_adv_test \
 	qual_basic_test \
 	qual_is_test \
Index: tests/hard_coded/pragma_export.exp
===================================================================
RCS file: pragma_export.exp
diff -N pragma_export.exp
--- /dev/null	Thu Mar 30 14:06:13 2000
+++ pragma_export.exp	Thu Aug 24 19:34:54 2000
@@ -0,0 +1 @@
+pragma_export test succeeded
Index: tests/hard_coded/pragma_export.m
===================================================================
RCS file: pragma_export.m
diff -N pragma_export.m
--- /dev/null	Thu Mar 30 14:06:13 2000
+++ pragma_export.m	Thu Aug 24 18:16:47 2000
@@ -0,0 +1,20 @@
+% This test case tests using `pragma export' on a procedure defined
+% in a different module (in this case, one from the standard library).
+% Previously the MLDS back-end was failing this test case.
+
+:- module pragma_export.
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+main -->
+	my_write_string("pragma_export test succeeded\n").
+
+:- pred my_write_string(string::in, io__state::di, io__state::uo) is det.
+
+:- pragma import(my_write_string(in, di, uo), may_call_mercury, "write_str").
+
+:- pragma export(io__write_string(in, di, uo), "write_str").

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list