Fix type compatibility for types with flexible array member 2/2 [PR113688,PR114713...
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-19.c
blob3581616d754d5089df98d1aafe04b300aab3455c
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 #include <stdio.h>
10 int
11 main (int argc, char **argv)
13 const int N = 256;
14 int i;
15 unsigned char *h[N];
17 for (i = 0; i < N; i++)
19 int j;
20 unsigned char *p;
22 h[i] = (unsigned char *) malloc (N);
23 p = h[i];
25 for (j = 0; j < N; j++)
27 p[j] = i;
30 (void) acc_copyin (p, N);
33 for (i = 0; i < N; i++)
35 memset (h[i], 0, i);
38 for (i = 0; i < N; i++)
40 int j;
41 unsigned char *p;
43 acc_copyout (h[i], N);
45 p = h[i];
47 for (j = 0; j < N; j++)
49 if (p[j] != i)
50 abort ();
54 for (i = 0; i < N; i++)
56 free (h[i]);
59 return 0;