]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Adjust powerpc ppc-fortran.exp to support dg-{warning,error}
authorKewen Lin <linkw@linux.ibm.com>
Wed, 8 Mar 2023 06:57:21 +0000 (00:57 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Wed, 8 Mar 2023 06:57:21 +0000 (00:57 -0600)
According to Haochen's finding in [1], currently ppc-fortran.exp
doesn't support Fortran specific warning or error messages well.
By looking into it, it's due to that gfortran uses some different
warning/error prefixes as follows:

    set gcc_warning_prefix "\[Ww\]arning:"
    set gcc_error_prefix "(Fatal )?\[Ee\]rror:"

comparing to:

    set gcc_warning_prefix "warning:"
    set gcc_error_prefix "(fatal )?error:"

So this is to override these two prefixes and make it support
dg-{warning,error} checks.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613302.html

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: Override
gcc_{warning,error}_prefix with Fortran specific one used in
gfortran_init.

gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp

index a556d7b48a38940e392cae1224e760d29b87a02e..f7e99ac8487534709295954b9f035c60207013b3 100644 (file)
@@ -58,6 +58,11 @@ proc dg-compile-aux-modules { args } {
     }
 }
 
+# Override gcc_{warning,error}_prefix with Fortran specific prefixes used
+# in gfortran_init to support dg-{warning,error} checks.
+set gcc_warning_prefix "\[Ww\]arning:"
+set gcc_error_prefix "(Fatal )?\[Ee\]rror:"
+
 # Main loop.
 gfortran-dg-runtest [lsort \
        [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" $DEFAULT_FFLAGS