[m-rev.] diff: add test case for nested modules bug
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Mar 6 04:38:16 AEDT 2002
Branches: main
Estimated hours taken: 0.5
tests/hard_coded/sub-modules/Mmakefile:
tests/hard_coded/sub-modules/accessibility.m:
tests/hard_coded/sub-modules/sub_a.m:
Add a test case showing a bug in the handling
of accessibility checks for nested modules.
The test is not yet enabled, since we do not yet pass it.
Workspace: /home/ceres/fjh/mercury
Index: tests/hard_coded/sub-modules/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/sub-modules/Mmakefile,v
retrieving revision 1.4
diff -u -d -r1.4 Mmakefile
--- tests/hard_coded/sub-modules/Mmakefile 15 Nov 2001 15:01:30 -0000 1.4
+++ tests/hard_coded/sub-modules/Mmakefile 5 Mar 2002 17:34:35 -0000
@@ -27,6 +27,12 @@
class \
nested_intermod_main
+# The following test case is not enabled,
+# because we do not yet pass it:
+# accessibility
+# Shows up a bug where the nested module accessibility check
+# reports some spurious errors.
+
MCFLAGS-nested_intermod = --intermodule-optimization
MCFLAGS-nested_intermod_main = --intermodule-optimization
Index: tests/hard_coded/sub-modules/accessibility.m
===================================================================
RCS file: tests/hard_coded/sub-modules/accessibility.m
diff -N tests/hard_coded/sub-modules/accessibility.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/sub-modules/accessibility.m 5 Mar 2002 17:35:47 -0000
@@ -0,0 +1,29 @@
+% A regression test -- the compiler issues a spurious
+% error for this test case.
+
+:- module accessibility.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+:- import_module sub_a.
+
+:- module nested.
+:- interface.
+
+/* This line should _not_ be needed,
+ since it already occurs in the containing module. */
+% :- import_module sub_a.
+
+:- import_module sub_a:sub1.
+:- type t3 == sub_a:sub1:t2.
+:- end_module nested.
+
+main -->
+ io__write_string("Hello.\n").
+
Index: tests/hard_coded/sub-modules/sub_a.m
===================================================================
RCS file: tests/hard_coded/sub-modules/sub_a.m
diff -N tests/hard_coded/sub-modules/sub_a.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/hard_coded/sub-modules/sub_a.m 5 Mar 2002 17:24:45 -0000
@@ -0,0 +1,31 @@
+
+:- module sub_a.
+
+:- interface.
+
+:- type t1.
+
+:- module sub1.
+
+:- interface.
+
+:- type t2.
+
+:- end_module sub1.
+
+:- implementation.
+
+:- module sub1.
+
+:- implementation.
+
+:- import_module int.
+
+:- type t2 == int.
+
+:- end_module sub1.
+
+:- import_module float.
+
+:- type t1 == float.
+
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list