builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr86835.c
bloba0ebc7432aa9894376c4b856d312795462bf6a4f
1 /* PR tree-optimization/86835 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -ffast-math -Wuninitialized" } */
5 __attribute__((noipa)) void
6 foo (int n, double *x, double *y)
7 { /* { dg-bogus "is used uninitialized in this function" "" { target *-*-* } 0 } */
8 int i;
9 double b = y[4];
10 for (i = 0; i < n; ++i)
11 y[3] += __builtin_sin (x[i] / b);
12 y[0] /= b;
13 y[1] /= b * b;
14 y[2] /= b;
17 int
18 main ()
20 double y[] = { 16.0, 64.0, 128.0, 0.0, 2.0 };
21 foo (0, y, y);
22 if (__builtin_fabs (y[0] - 8.0) > 0.0001
23 || __builtin_fabs (y[1] - 16.0) > 0.0001
24 || __builtin_fabs (y[2] - 64.0) > 0.0001
25 || y[3] != 0.0
26 || y[4] != 2.0)
27 __builtin_abort ();
28 return 0;