Improve atomic store implementation on hppa-linux.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-loop-and-seq-5.c
blob67dcce26c894ec758c6ee22f7379d8e3f585f4dd
1 #include <stdlib.h>
3 #define N 32
5 unsigned int
6 foo (int n, unsigned int *a)
8 int r;
9 #pragma acc kernels copyout(r) copy (a[0:N])
11 r = a[0];
13 for (int i = 0; i < n; i++)
14 a[i] = 1;
17 return r;
20 int
21 main (void)
23 unsigned int a[N];
24 unsigned res, i;
26 for (i = 0; i < N; ++i)
27 a[i] = i % 4;
29 res = foo (N, a);
30 if (res != 0)
31 abort ();
33 return 0;