This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V2 2/2] fortran: Testsuite, fix different type naming across compilers.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Bernhard Heckel <bernhard dot heckel at intel dot com>
- Cc: qiyaoltc at gmail dot com, gdb-patches at sourceware dot org, brobecker at adacore dot com
- Date: Fri, 15 Apr 2016 15:41:13 +0100
- Subject: Re: [PATCH V2 2/2] fortran: Testsuite, fix different type naming across compilers.
- Authentication-results: sourceware.org; auth=none
- References: <1460724297-23523-1-git-send-email-bernhard dot heckel at intel dot com> <1460724297-23523-3-git-send-email-bernhard dot heckel at intel dot com>
Bernhard Heckel <bernhard.heckel@intel.com> writes:
> -# Depending on the compiler version being used, the name of the 4-byte integer
> -# and real types can be printed differently. For instance, gfortran-4.1 uses
> -# "int4" whereas gfortran-4.3 uses "int(kind=4)".
> -set int4 "(int4|integer\\(kind=4\\))"
> -set real4 "(real4|real\\(kind=4\\))"
> -
> -gdb_test "ptype p" "type = Type bar\r\n *${int4} :: c\r\n *${real4} :: d\r\n *End Type bar"
> +gdb_test "ptype p" "type = Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type bar"
> +
> +proc fortran_int4 {} {
> + if {[test_compiler_info {gcc-4-[012]-*}]} {
> + return "int4"
> + } elseif {[test_compiler_info {gcc-*}]} {
> + return "integer\\(kind=4\\)"
> + } elseif {[test_compiler_info {icc-*}]} {
> + return "INTEGER\\(4\\)"
> + } else {
> + return "unknown"
> + }
> +}
> +
> +
> +if ![info exists int4] then {
> + set int4 [fortran_int4]
> +}
Why do you prefer to define these info? In each test, we can do
set int4 [fortran_int4],
IMO, that is much cleaner than your current approach (define int4
globally in lib/fortran.exp and use it everywhere).
--
Yao (éå)