public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: gdb@sources.redhat.com
Subject: Proper test status if gdb test detects a g++ bug?
Date: Sun, 04 Feb 2001 00:27:00 -0000	[thread overview]
Message-ID: <200102040827.AAA29200@bosch.cygnus.com> (raw)

I'm working on testsuite/gdb.c++/cplusfuncs.exp in an effort to make
it work well with g++ 2.95 and g++ 3.0.

For reference, my configuration is Red Hat Linux 7 native.

I'm having a problem with this test:

  [1] print_addr_of "hairyfunc5(int (*(*)(char *))(long))"

The problem is that this argument type is incorrect.  The test with the
corect argument type would be:

  [2] print_addr_of "hairyfunc5(int (*)(long) (*)(char *))"

The argument type string comes from g++ stabs info.

So, if I use the correct test [2], then the test will fail when the
tester uses a g++ 2.95 compiler.  Personally I like it this way.  g++
2.95 has this bug and I think a gdb test script should issue a FAIL,
even though the bug is in a different component.  That's alternative #1.

Alternative #2A is to treat a known bug in an external component as
an XFAIL.  If I just use "setup_xfail", then the test will give XPASS
when the user has g++ 3.0 (g++ 3.0 fixed this bug).  I am lukewarm about
this but it's simple to code.

Alternative #2B is to probe the target compiler some more and issue a
PASS for the correct output, an XFAIL if the output is the known bad
string from a known bad compiler, and a FAIL otherwise.  This requires
a bunch more test script code with custom send/expect.

Which direction should I go?

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"

P. S.  Here is a brief explanation why the arg type is incorrect
       as written.   A pointer-to-function always has the following type:
       "returntype (*)(arglist)".  The arg type in [1] does not have a (*)
       at the top nesting level, so it is not a legal pointer-to-function.
       The arg type in [2] says: the arg is a pointer-to-function which
       returns an int and takes a single parameter which is another
       pointer-to-function that returns a long and takes a single char *
       parameter.  This arg type matches the declarations in cplusfuncs.c.

             reply	other threads:[~2001-02-04  0:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-04  0:27 Michael Elizabeth Chastain [this message]
2001-02-04  0:49 ` Eli Zaretskii
2001-02-04  2:56 ` Alexandre Oliva
2001-02-04 11:56 ` Andrew Cagney
2001-02-04 12:14 Michael Elizabeth Chastain
2001-02-04 12:44 ` Andrew Cagney
2001-02-04 15:05 Michael Elizabeth Chastain
2001-02-04 17:50 Michael Elizabeth Chastain
2001-02-05  8:44 ` Alexandre Oliva
2001-02-05  8:54 Michael Elizabeth Chastain
2001-02-05 10:03 ` Andrew Cagney
2001-02-05 10:26   ` Alexandre Oliva
2001-02-05 10:40     ` Andrew Cagney
2001-02-05 11:38       ` Alexandre Oliva
2001-02-05 10:27 Michael Elizabeth Chastain

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=200102040827.AAA29200@bosch.cygnus.com \
    --to=chastain@cygnus.com \
    --cc=gdb@sources.redhat.com \
    /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).