Hi!

While looking for something else -- isn't that always how it happens ;-)
-- I noticed one thing here:

On Wed, 25 Jun 2014 01:41:02 +0200, FX <fxcoud...@gmail.com> wrote:
> I’ll wait a few more days to commit, so others can comment/review and I am 
> sure to be around if there is fallout.

(This got committed to trunk in r212102.)

> --- gcc/testsuite/gfortran.dg/ieee/ieee.exp   (revision 0)
> +++ gcc/testsuite/gfortran.dg/ieee/ieee.exp   (revision 0)
> @@ -0,0 +1,59 @@
> +[...]
> +global DEFAULT_FFLAGS
> +if ![info exists DEFAULT_FFLAGS] then {
> +    set DEFAULT_FFLAGS ""
> +}
> +[...]

Per my understanding of DejaGnu (and please correct me if that's wrong),
in the same 'runtest' instance, 'global' variables persist from one
'*.exp' file to another.  (Which is something debatable, in my
opinion...)

All other '*.exp' files that back then did define 'DEFAULT_FFLAGS' (using
this same construct as shown above), and it's still the same now, are
using " -pedantic-errors" instead of the empty string.  Thus this setting
of 'DEFAULT_FFLAGS' is not idempotent, depends on whether
'gfortran.dg/ieee/ieee.exp', or an other defining '*.exp' file is
executed first.

By default, first comes 'gfortran.dg/coarray/caf.exp' (nowadays, did not
yet exist back then), then 'gfortran.dg/dg.exp', then
'gfortran.dg/ieee/ieee.exp'.  (And, sometimes also
'gcc.target/powerpc/ppc-fortran/ppc-fortran.exp'.)

And, as I just noticed, 'runtest' seems to always sort the specified
'*.exp' files (?!), so even when you invoke something like
"check-gcc-fortran RUNTESTFLAGS='ieee.exp dg.exp'" to try to provoke some
regressions to appear, you'd still get 'dg.exp' executed first.  The
empty string setting in 'ieee.exp' was never really active -- only if
executed on its own, etc.

Fortunately, 'ieee.exp' seems to behave the same way whether running with
or without '-pedantic-errors', so I propose to simply unify that setting,
see attached.  OK to commit this to all relevant branches?  If approving
this patch, please respond with "Reviewed-by: NAME <EMAIL>" so that your
effort will be recorded in the commit log, see
<https://gcc.gnu.org/wiki/Reviewed-by>.


Grüße
 Thomas


From 214a3ac1b44343c5b1bbd2963bc256b056dac764 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Thu, 28 Feb 2019 20:08:25 +0100
Subject: [PATCH] [testsuite, Fortran] Consistently set 'DEFAULT_FFLAGS'

In the same 'runtest' instance, 'global' variables persist from one '*.exp'
file to another.

All other '*.exp' files are using " -pedantic-errors" instead of the empty
string as the default for 'DEFAULT_FFLAGS'.  Thus this setting of
'DEFAULT_FFLAGS' is not idempotent, depends on whether
'gfortran.dg/ieee/ieee.exp', or an other defining '*.exp' file is executed
first.

	gcc/testsuite/
	PR fortran/29383
	* gfortran.dg/ieee/ieee.exp (DEFAULT_FFLAGS): Set the same as in
	other '*.exp' files.
---
 gcc/testsuite/gfortran.dg/ieee/ieee.exp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/ieee/ieee.exp b/gcc/testsuite/gfortran.dg/ieee/ieee.exp
index 05383ce94331..68d4b7816144 100644
--- a/gcc/testsuite/gfortran.dg/ieee/ieee.exp
+++ b/gcc/testsuite/gfortran.dg/ieee/ieee.exp
@@ -22,15 +22,15 @@
 load_lib gfortran-dg.exp
 load_lib target-supports.exp
 
-# Initialize `dg'.
-dg-init
-
-# Flags specified in each test
+# If a testcase doesn't have special options, use these.
 global DEFAULT_FFLAGS
 if ![info exists DEFAULT_FFLAGS] then {
-    set DEFAULT_FFLAGS ""
+    set DEFAULT_FFLAGS " -pedantic-errors"
 }
 
+# Initialize `dg'.
+dg-init
+
 # Flags for finding the IEEE modules
 if [info exists TOOL_OPTIONS] {
    set specpath [get_multilibs ${TOOL_OPTIONS}]
-- 
2.17.1

Attachment: signature.asc
Description: PGP signature

Reply via email to