Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / 387-9.c
blob2667aa46872d6d66b4df58aa69c39a61330a205e
1 /* Verify that 387 fsincos instruction is generated. */
2 /* { dg-do compile } */
3 /* { dg-options "-O -funsafe-math-optimizations -mfpmath=387 -mfancy-math-387" } */
5 extern double sin (double);
6 extern double cos (double);
7 extern void sincos (double, double *, double *);
9 double f1(double x)
11 double s, c;
12 sincos (x, &s, &c);
13 return s + c;
16 double f2(double x)
18 double s, c, tmp;
19 sincos (x, &s, &tmp);
20 c = cos (x);
21 return s + c;
24 double f3(double x)
26 double s, c, tmp;
27 sincos (x, &tmp, &c);
28 s = sin (x);
29 return s + c;
32 /* { dg-final { scan-assembler "fsincos" } } */
33 /* { dg-final { scan-assembler-not "fsin " } } */
34 /* { dg-final { scan-assembler-not "fcos" } } */
35 /* { dg-final { scan-assembler-not "call" } } */