AVR: Assert minimal required bit width of section_common::flags.
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-loop-mod-not-zero.c
blob147ebb5994536c1ececa8f868885a90674b7dea8
1 #include <stdlib.h>
3 #define N ((1024 * 512) + 1)
4 #define COUNTERTYPE unsigned int
6 int
7 main (void)
9 unsigned int *__restrict a;
10 unsigned int *__restrict b;
11 unsigned int *__restrict c;
13 a = (unsigned int *__restrict)malloc (N * sizeof (unsigned int));
14 b = (unsigned int *__restrict)malloc (N * sizeof (unsigned int));
15 c = (unsigned int *__restrict)malloc (N * sizeof (unsigned int));
17 for (COUNTERTYPE i = 0; i < N; i++)
18 a[i] = i * 2;
20 for (COUNTERTYPE i = 0; i < N; i++)
21 b[i] = i * 4;
23 #pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N])
25 for (COUNTERTYPE ii = 0; ii < N; ii++)
26 c[ii] = a[ii] + b[ii];
29 for (COUNTERTYPE i = 0; i < N; i++)
30 if (c[i] != a[i] + b[i])
31 abort ();
33 free (a);
34 free (b);
35 free (c);
37 return 0;