[m-rev.] diff: update float_consistency test

Simon Taylor stayl at cs.mu.OZ.AU
Thu Jun 12 14:05:44 AEST 2003


Estimated hours taken: 0.1
Branches: main, release

tests/hard_coded/float_consistency.m:
	Change calls to float./ to float.unchecked_quotient.
	This test case is meant to test compile-time evaluation
	of builtins. float./ hasn't been builtin for a while.
	This test case fails with --optimize-constant-propagation.

tests/hard_coded/Mercury.options:
	Enable --optimize-constant-propagation for this test.

Index: Mercury.options
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mercury.options,v
retrieving revision 1.5
diff -u -u -r1.5 Mercury.options
--- Mercury.options	21 Feb 2003 01:57:30 -0000	1.5
+++ Mercury.options	12 Jun 2003 04:04:00 -0000
@@ -6,6 +6,7 @@
 MCFLAGS-deforest_cc_bug =	--deforestation
 MCFLAGS-lp		=	--intermodule-optimization -O3
 MCFLAGS-boyer		=	--infer-all
+MCFLAGS-float_consistency =	--optimize-constant-propagation
 MCFLAGS-func_test	=	--infer-all
 MCFLAGS-ho_order	=	--optimize-higher-order
 MCFLAGS-ho_order2	=	--optimize-higher-order
Index: float_consistency.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/float_consistency.m,v
retrieving revision 1.1
diff -u -u -r1.1 float_consistency.m
--- float_consistency.m	24 Nov 2002 03:57:36 -0000	1.1
+++ float_consistency.m	12 Jun 2003 03:51:43 -0000
@@ -16,7 +16,10 @@
         print("Calc_one     = Lit_one:     " ++ 
 	     (if Calc_one = Lit_one then "true" else "false")), nl,
         print("Calc_one/9.0 = Lit_one/9.0: " ++
-	     (if Calc_one/9.0 = Lit_one/9.0 then "true" else "false")), nl.
+	     (if unchecked_quotient(Calc_one, 9.0)
+	     		= unchecked_quotient(Lit_one, 9.0)
+		then "true" else "false")),
+	nl.
 
 :- pragma no_inline(same_as/1).
 :- func same_as(float) = float.
--------------------------------------------------------------------------
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