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

Joseph S. Myers
2011-05-19T10:16:43Z

On Thu, 19 May 2011, Mark Kettenis wrote:

> 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.

I don't believe the breakage (issues such as mixed real/complex arithmetic
wrongly converting the real operand to complex type, with implications for
NaNs and signed zeros) is of any relevance to the GDB tests.

I'd think the right approach is simply to see if the compiler accepts a
trivial source file of the form

_Complex float cf;
_Complex double cd;
_Complex long double cld;

and if it does, then presume complex support is present.

--
Joseph S. Myers
joseph@codesourcery.com