summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/387-9.c
blob: 2667aa46872d6d66b4df58aa69c39a61330a205e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Verify that 387 fsincos instruction is generated.  */
/* { dg-do compile } */
/* { dg-options "-O -funsafe-math-optimizations -mfpmath=387 -mfancy-math-387" } */

extern double sin (double);
extern double cos (double);
extern void sincos (double, double *, double *);

double f1(double x)
{
  double s, c;
  sincos (x, &s, &c);
  return s + c;
}

double f2(double x)
{
  double s, c, tmp;
  sincos (x, &s, &tmp);
  c = cos (x);
  return s + c;
}

double f3(double x)
{
  double s, c, tmp;
  sincos (x, &tmp, &c);
  s = sin (x);
  return s + c;
}

/* { dg-final { scan-assembler "fsincos" } } */
/* { dg-final { scan-assembler-not "fsin " } } */
/* { dg-final { scan-assembler-not "fcos" } } */
/* { dg-final { scan-assembler-not "call" } } */