[m-rev.] private_builtin.m improvements & purity warning bugfix

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jan 4 16:56:21 AEDT 2002


On 13-Dec-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> On 13-Dec-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > Code which exercises this bug is in library/private_builtin.m
> > after my change.  Do we really need a separate test case?
> 
> It's usually a good idea. Code in the library can be removed or
> changed so it no longer exercises the bug.

----------

Estimated hours taken: 0.75
Branches: main

tests/valid/Mmakefile:
tests/valid/spurious_purity_warning.m:
	A regression test for a bug in purity analysis that I fixed on
	Dec 13th 2001.

Workspace: /mnt/earth/home/earth/fjh/ws-earth4/mercury
Index: tests/valid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/valid/Mmakefile,v
retrieving revision 1.93
diff -u -d -r1.93 Mmakefile
--- tests/valid/Mmakefile	2001/12/29 06:37:33	1.93
+++ tests/valid/Mmakefile	2002/01/04 05:46:28
@@ -144,6 +144,7 @@
 	simplify_bug.m \
 	soln_context.m \
 	some_switch.m \
+	spurious_purity_warning.m \
 	stack_alloc.m \
 	static.m \
 	subtype_switch.m \
@@ -289,6 +290,7 @@
 MCFLAGS-pred_with_no_modes	= --infer-all
 MCFLAGS-quantifier_warning	= --halt-at-warn
 MCFLAGS-simplify_bug		= -O-1
+MCFLAGS-spurious_purity_warning	= --halt-at-warn
 MCFLAGS-two_way_unif		= -O-1
 MCFLAGS-type_inf_ambig_test	= --infer-all
 MCFLAGS-typeclass_det_warning	= --halt-at-warn
Index: tests/valid/spurious_purity_warning.m
===================================================================
RCS file: spurious_purity_warning.m
diff -N spurious_purity_warning.m
--- /dev/null	Mon Dec 17 21:20:53 2001
+++ spurious_purity_warning.m	Fri Jan  4 16:45:38 2002
@@ -0,0 +1,24 @@
+:- module spurious_purity_warning.
+:- interface.
+
+:- impure pred foo(int::out) is det.
+:- impure pred bar(int::in) is det.
+
+:- implementation.
+:- import_module require.
+
+foo(_::out) :-
+	error("foo/1").
+bar(_::in) :-
+	error("bar/1").
+
+:- pragma foreign_proc("C", foo(X::out),
+	[will_not_call_mercury, thread_safe],
+"
+	X = 0;
+").
+
+:- pragma foreign_proc("C", bar(_X::in),
+	[will_not_call_mercury, thread_safe],
+"
+").

-- 
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