C++: simplify output from suggest_alternatives_for
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-reduction.c
blob8647a9432fc6cacee993491ebf06a1fec56743d0
1 #include <stdlib.h>
3 #define n 10000
5 unsigned int a[n];
7 void __attribute__((noinline,noclone))
8 foo (void)
10 int i;
11 unsigned int sum = 1;
13 #pragma acc kernels copyin (a[0:n]) copy (sum)
15 for (i = 0; i < n; ++i)
16 sum += a[i];
19 if (sum != 5001)
20 abort ();
23 int
24 main ()
26 int i;
28 for (i = 0; i < n; ++i)
29 a[i] = i % 2;
31 foo ();
33 return 0;