aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/fabd.c
blob: 7206d5e95c73520875f8ace2fee5ed2a3b5c7fd0 (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
36
37
38
/* { dg-do run } */
/* { dg-options "-O1 -fno-inline --save-temps" } */

extern double fabs (double);
extern float fabsf (float);
extern void abort ();
extern void exit (int);

void
fabd_d (double x, double y, double d)
{
  if ((fabs (x - y) - d) > 0.00001)
    abort ();
}

/* { dg-final { scan-assembler "fabd\td\[0-9\]+" } } */

void
fabd_f (float x, float y, float d)
{
  if ((fabsf (x - y) - d) > 0.00001)
    abort ();
}

/* { dg-final { scan-assembler "fabd\ts\[0-9\]+" } } */

int
main ()
{
  fabd_d (10.0, 5.0, 5.0);
  fabd_d (5.0, 10.0, 5.0);
  fabd_f (10.0, 5.0, 5.0);
  fabd_f (5.0, 10.0, 5.0);

  return 0;
}

/* { dg-final { cleanup-saved-temps } } */