Fix type compatibility for types with flexible array member 2/2 [PR113688,PR114713...
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-94.c
blobbaa3ac83f04adb7d6980ef395e9b81cdd1f1687b
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
4 #include <string.h>
5 #include <stdlib.h>
6 #include <openacc.h>
8 int
9 main (int argc, char **argv)
11 const int N = 256;
12 int i;
13 int async = 8;
14 unsigned char *h;
16 h = (unsigned char *) malloc (N);
18 for (i = 0; i < N; i++)
20 h[i] = i;
23 acc_copyin_async (h, N, async);
25 acc_wait (async);
27 memset (h, 0, N);
29 acc_copyout_async (h, N, async + 1);
31 acc_wait (async + 1);
33 for (i = 0; i < N; i++)
35 if (h[i] != i)
36 abort ();
39 free (h);
41 return 0;