My recent test case builtins-20.c is currently failing on sh-elf
and presumably several other non-linux platforms (thanks to Joern
Rennecke for bringing this to my attention). The problem is that
this optimization/test case attempt to synthesize the use of a
C99 function that isn't guaranteed to be available on all platforms.
So although "sin(x)/cos(x) != tan(x)" should work everywhere, the
optimizer will only convert "sinf(x)/cosf(x)" into tanf(x) on platforms
where it is known this function will be present. So this testcase
has been failing on those platforms where GCC can't guarantee a c99
library.
The following patch splits the original testcase gcc.dg/builtins-20.c
into two parts. One test program for double functions that only
requires c90 functionality remains in builtins-20.c, and a second
test program builtins-22.c that contains the float and long double
tests, which is only executed on *-*-linux*.
[In practice, the test2f and test2l optimizations will be applied
everywhere, but the split below is much cleaner conceptually.]
Ok for mainline?