* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-49.c
bloba33324c31baaf1d7d623e2c74c73191c467c5714
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 unsigned char *h;
14 void *d;
16 h = (unsigned char *) malloc (N);
18 for (i = 0; i < N; i++)
20 h[i] = i;
23 d = acc_copyin (h, N);
24 if (!d)
25 abort ();
27 memset (&h[0], 0, N);
29 acc_update_self (h, N - 2);
31 for (i = 0; i < N - 2; i++)
33 if (h[i] != i)
34 abort ();
37 for (i = N - 2; i < N; i++)
39 if (h[i] != 0)
40 abort ();
43 acc_delete (h, N);
45 free (h);
47 return 0;