2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / fabsneg-1.c
blob3cdf456686413541614b0764325a64ac97e26862
1 /* { dg-do run } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2 -mtune=nocona" } */
5 double x;
7 void
8 __attribute__ ((noinline, noclone))
9 test_fabs (double a)
11 asm volatile ("" : "+r" (a));
12 x = __builtin_fabs (a);
15 void
16 __attribute__ ((noinline, noclone))
17 test_neg (double a)
19 asm volatile ("" : "+r" (a));
20 x = -a;
23 int main ()
25 test_fabs (-1.0);
27 if (x != 1.0)
28 __builtin_abort ();
30 test_neg (-1.0);
32 if (x != 1.0)
33 __builtin_abort ();
35 return 0;