[m-dev.] diff: disable MR_UNIFY_COMPARE_BY_TYPE_CTOR_INFO

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 27 01:01:07 AEST 1999


I'll commit this work-around for now.
If/when someone fixes the bug so that the test case
passes, they can undo the change to mercury_ho_call.c.

----------

Estimated hours taken: 0.5

runtime/mercury_ho_call.c:
	Disable the MR_UNIFY_COMPARE_BY_CTOR_REP code,
	because it does the wrong thing for enumerations
	with user-defined equality types.

tests/hard_coded/Mmakefile:
tests/hard_coded/user_defined_equality.m:
tests/hard_coded/user_defined_equality.exp:
	Add a regression test.

Workspace: /home/mercury0/fjh/mercury
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.24
diff -u -d -r1.24 mercury_ho_call.c
--- mercury_ho_call.c	1999/10/19 05:26:10	1.24
+++ mercury_ho_call.c	1999/10/26 06:35:12
@@ -8,9 +8,14 @@
 ** Public License - see the file COPYING.LIB in the Mercury distribution.
 */
 
-#define	MR_UNIFY_COMPARE_BY_CTOR_REP
+/*
+XXX currently the MR_UNIFY_COMPARE_BY_CTOR_REP code is broken;
+it fails the tests/hard_coded/user_defined_equality.m test case.
+So for now it is disabled.
+#define MR_UNIFY_COMPARE_BY_CTOR_REP	
 #define	MR_UNIFY_COMPARE_BY_CTOR_REP_SPEC_1
 #define	MR_UNIFY_COMPARE_BY_CTOR_REP_SPEC_2
+*/
 
 /*
 ** This module provides much of the functionality for doing higher order
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.68
diff -u -d -r1.68 Mmakefile
--- Mmakefile	1999/10/25 03:53:14	1.68
+++ Mmakefile	1999/10/26 12:23:53
@@ -99,6 +99,7 @@
 	term_io_test \
 	tim_qual1 \
 	type_spec \
+	user_defined_equality \
 	write \
 	write_reg1
 
@@ -121,6 +122,7 @@
 MCFLAGS-rnd		=	-O6
 MCFLAGS-type_spec	=	--user-guided-type-specialization
 MCFLAGS-existential_types_test = --infer-all
+MCFLAGS-user_defined_equality	= --infer-all
 
 # In grade `none' with options `-O1 --opt-space' on kryten
 # (a sparc-sun-solaris2.5 system), mode_choice needs to be linked
cvs diff: tests/hard_coded/user_defined_equality.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/user_defined_equality.m is a new entry, no comparison available
==============================
tests/hard_coded/user_defined_equality.exp
==============================
yes
==============================
tests/hard_coded/user_defined_equality.m
==============================
% This is a regression test;
% the Mercury compiler of 26/10/1999 failed this test.

:- module user_defined_equality.
:- interface.
:- import_module io.

:- pred main(io__state::di, io__state::uo) is det.

:- implementation.
:- import_module list, std_util.

:- type foo ---> bar ; baz
	where equality is foo_equal.

foo_equal(_, _) :-
	semidet_succeed.

main -->
	( { append([bar], [baz], [baz, bar]) } ->
		print("yes"), nl
	;
		print("no"), nl
	).
==============================

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