[PATCH 13/18] testsuite, fortran: fix info-types for intel compilers

Andrew Burgess aburgess@redhat.com
Wed May 11 12:06:27 GMT 2022


Nils-Christian Kempke <nils-christian.kempke@intel.com> writes:

> First, the emitted symbol character*1 which is checked in the test
> is not even referenced as a type in the compiled examples.  It seems
> to be a gfortran specific check for some type that gets emitted always.
> I changed the test to use check_optional_entry here to allow the
> symbol's absence.
>
> Second, the line checked for s1 was hardcoded in the test.  Given that
> the type is actually defined on line 41 (which is what is emitted by
> ifx) it even seems wrong.  I changed the line check for s1 to actually
> check for 41 and a gfortran bug has been filed here
>
>    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105454
>
> The test is now marked as xfail for gfortran.
>
> Third, the test was checking for s1 to be emitted by info types.  This
> would mean that the type is put into compilation unit scope in the DWARF
> but, as it is local to the main program this is actually not expected
> and gfortran specific.
> Since I already added the xfail for gfortran here, I opted to also make
> this check gfortran specific.
> ---
>  gdb/testsuite/gdb.fortran/info-types.exp | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.fortran/info-types.exp b/gdb/testsuite/gdb.fortran/info-types.exp
> index 67fe4d79c5..06770aada1 100644
> --- a/gdb/testsuite/gdb.fortran/info-types.exp
> +++ b/gdb/testsuite/gdb.fortran/info-types.exp
> @@ -41,12 +41,16 @@ set real4 [fortran_real4]
>  GDBInfoSymbols::run_command "info types"
>  GDBInfoSymbols::check_header "All defined types:"
>  
> -GDBInfoSymbols::check_entry "${srcfile}" "" "${character1}"
> +GDBInfoSymbols::check_optional_entry "${srcfile}" "" "${character1}"

Could we not just add a reference to character*1 type?  I'm happy to
take this change, but just adding a use might make a stronger test?

>  GDBInfoSymbols::check_entry "${srcfile}" "" "${integer4}"
>  GDBInfoSymbols::check_entry "${srcfile}" "" "${logical4}"
>  GDBInfoSymbols::check_entry "${srcfile}" "$decimal" "Type m1t1;"
>  GDBInfoSymbols::check_entry "${srcfile}" "" "${real4}"
> -GDBInfoSymbols::check_entry "${srcfile}" "37" "Type s1;"
> +
> +if { [test_compiler_info {gfortran-*} f90] } {
> +    setup_xfail *-*-* gcc/105454
> +    GDBInfoSymbols::check_entry "${srcfile}" "41" "Type s1;"
> +}

Shouldn't the GDBInfoSymbols::check_entry call be outside of the if
block?  I think, with your change, the test will _only_ be run on
gfortran, which is not what you wanted.

Thanks,
Andrew


>  
>  return 0
>  
> @@ -62,5 +66,5 @@ gdb_test "info types" \
>  	 "(35:\[\t \]+Type __vtype_mod1_M1t1;" \
>  	 ")?$decimal:\[\t \]+Type m1t1;" \
>  	 "\[\t \]+${real4}" \
> -	 "37:\[\t \]+Type s1;(" \
> +	 "41:\[\t \]+Type s1;(" \
>  	 ".*)?"]
> -- 
> 2.25.1
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the Gdb-patches mailing list