public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Bernhard Heckel <bernhard.heckel@intel.com>
Cc: qiyaoltc@gmail.com,  gdb-patches@sourceware.org,  brobecker@adacore.com
Subject: Re: [PATCH V2 2/2] fortran: Testsuite, fix different type naming across compilers.
Date: Fri, 15 Apr 2016 14:41:00 -0000	[thread overview]
Message-ID: <86oa9bkk8m.fsf@gmail.com> (raw)
In-Reply-To: <1460724297-23523-3-git-send-email-bernhard.heckel@intel.com>	(Bernhard Heckel's message of "Fri, 15 Apr 2016 14:44:57 +0200")

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 (齐尧)

  reply	other threads:[~2016-04-15 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 12:46 [PATCH V2 0/2] " Bernhard Heckel
2016-04-15 12:47 ` [PATCH V2 2/2] " Bernhard Heckel
2016-04-15 14:41   ` Yao Qi [this message]
2016-04-18  7:15     ` Heckel, Bernhard
2016-04-15 12:47 ` [PATCH V2 1/2] testsuite: Support detection of Intel compilers via test_compiler_version Bernhard Heckel
2016-04-15 15:00   ` Yao Qi
2016-04-18  6:26     ` Heckel, Bernhard
2016-04-18  9:29       ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86oa9bkk8m.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=bernhard.heckel@intel.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).