gcc/
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr52547.c
blobf746e2ec469075e3de64a8cf5ad5bbc321b2e94d
1 /* PR middle-end/52547 */
2 /* { dg-do run } */
4 extern void abort (void);
6 __attribute__((noinline, noclone)) int
7 baz (int *x, int (*fn) (int *))
9 return fn (x);
12 __attribute__((noinline, noclone)) int
13 foo (int x, int *y)
15 int i, e = 0;
16 #pragma omp parallel for reduction(|:e)
17 for (i = 0; i < x; ++i)
19 __label__ lab;
20 int bar (int *z) { return z - y; }
21 if (baz (&y[i], bar) != i)
22 e |= 1;
24 return e;
27 int
28 main ()
30 int a[100], i;
31 for (i = 0; i < 100; i++)
32 a[i] = i;
33 if (foo (100, a))
34 abort ();
35 return 0;