Re: [_Complex test 1/4] support_complex_tests in gdb.exp and pass _Complex args to func

Mark Kettenis
2011-05-19T08:16:01Z

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 531120c..8be8396 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -1486,6 +1486,21 @@ proc skip_shlib_tests {} {
> return 1
> }
>
> +# Return a 1 if we should run tests to _Complex types, otherwise, skip it.
> +
> +proc support_complex_tests {} {
> + # In order to avoid breaking test on platforms not supporting _Complex,
> + # the list of target triplet supporting tests to _Complex type is still
> + # conservative. More target triplet can be added here if we are sure
> + # _Complex type is supported.
> + if {[istarget *-*-linux*]
> + || [istarget *-*-elf*]} {
> + return 1;

Sorry, but this is wrong on many levels. For one thing, _Complex
support has very little to do with with the OS you're running. It's
primarily a compiler issue. So you should probably use a test based
on test_compiler_info here. The GCC C99 status page suggests that the
first release to properly support complex is GCC 4.5. Earlier
versions are marked as "broken" but may actually have enough support
for these simple tests.

The other thing is that the testsuite should not be "conservative".
We should run as many tests as possible on as many platforms as
possible. Tests that are known to fail should be KFAILed (if there is
a known bug/issue with GDB itself) or XFAILed (if there is an issue
with the platform). Only if running the tests causes serious problems
(crashing the OS, causing excessive timeouts) we should consider
skipping them.