[m-rev.] diff: gcc back-end: update tests for tail recursion warnings

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Sep 20 20:01:46 AEST 2002


Estimated hours taken: 0.5
Branches: main

Fix a test case failure that occurs when testing the GCC back-end
with my patch to allow the front-end to mark calls as tail-calls.

tests/warnings/Mmakefile:
	Support multiple .exp* files.

tests/warnings/arg_order_rearrangment.exp2:
	New file.  Same as arg_order_rearrangement.exp, except that it
	also includes the warnings which the GCC back-end emits about
	missed tail recursion opportunities.

Workspace: /home/ceres/fjh/ws-gcc-basic-improvements-patched/mercury
Index: tests/warnings/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/Mmakefile,v
retrieving revision 1.23
diff -u -d -p -r1.23 Mmakefile
--- tests/warnings/Mmakefile	20 Sep 2002 09:40:40 -0000	1.23
+++ tests/warnings/Mmakefile	20 Sep 2002 09:47:14 -0000
@@ -46,11 +46,25 @@ $(ERRORCHECK_PROGS:%=%.runtest): %.runte
 
 %.res_error:	%.exp %.err
 	-rm -f $@
-	diff $(DIFF_OPTS) $*.exp $*.err > $@ || { cat $@ && exit 1; }
+	diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
+                { [ -f $*.exp2 ] && \
+                  diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
+                { [ -f $*.exp3 ] && \
+                  diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
+                { [ -f $*.exp4 ] && \
+                  diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
+                { cat $*.err; cat $@; exit 1; }
 
 %.res_compile:	%.exp %.c
 	-rm -f $@
-	diff $(DIFF_OPTS) $*.exp $*.err > $@ || { cat $@ && exit 1; }
+	diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
+                { [ -f $*.exp2 ] && \
+                  diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
+                { [ -f $*.exp3 ] && \
+                  diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
+                { [ -f $*.exp4 ] && \
+                  diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
+                { cat $*.err; cat $@; exit 1; }
 
 ifeq ($(MMAKE_USE_MMC_MAKE),yes)
 %.c: %.m
Index: tests/warnings/arg_order_rearrangment.exp2
===================================================================
RCS file: tests/warnings/arg_order_rearrangment.exp2
diff -N tests/warnings/arg_order_rearrangment.exp2
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/warnings/arg_order_rearrangment.exp2	20 Sep 2002 09:47:46 -0000
@@ -0,0 +1,11 @@
+arg_order_rearrangment.m:008: In predicate `arg_order_rearrangment:r/2'
+arg_order_rearrangment.m:014:   warning: the call to predicate
+arg_order_rearrangment.m:014:     `arg_order_rearrangment:app/3' has had the
+arg_order_rearrangment.m:014:     location of the variables `V_7' and `R0'
+arg_order_rearrangment.m:014:     swapped to allow accumulator introduction.
+arg_order_rearrangment.m:008:   Please ensure that these argument
+arg_order_rearrangment.m:008:     rearrangements do not introduce performance
+arg_order_rearrangment.m:008:     problems. These warnings can be suppressed by
+arg_order_rearrangment.m:008:     `--inhibit-accumulator-warnings'.
+arg_order_rearrangment.m: In function `r':
+arg_order_rearrangment.m:0: note: can't optimize tail call: callee arg size > caller arg size

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