[RFA] Fix csky and c6x build failures
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr100778.c
blob7997f2f2bcd9ac990a5b2dbd3e75793e5d157f10
1 /* { dg-do run { target *-*-*gnu* } } */
2 /* { dg-additional-options "-fno-tree-sink -fno-math-errno -ftree-vectorize -D_GNU_SOURCE" } */
3 /* { dg-require-effective-target fenv_exceptions } */
5 #include <fenv.h>
7 double a[2];
8 void __attribute__((noipa)) foo ()
10 double x = a[0];
11 double y = a[1];
12 double norm = __builtin_sqrt (x*x + y*y);
13 if (norm > 1.)
15 x = x / norm;
16 y = y / norm;
18 a[0] = x;
19 a[1] = y;
22 int main()
24 feenableexcept (FE_INVALID);
25 a[0] = 0.;
26 a[1] = 0.;
27 foo ();
28 if (a[0] != 0. || a[1] != 0.)
29 __builtin_abort ();
30 return 0;