Proper test status if gdb test detects a g++ bug?

Michael Elizabeth Chastain chastain@cygnus.com
Sun Feb 4 00:27:00 GMT 2001


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.


More information about the Gdb mailing list