Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-62.c
blob2e7184a918bbfb2625a599ad286ad39e451a4e28
1 /* Not all implement this checking.
2 { dg-skip-if "" { openacc_radeon_accel_selected || openacc_host_selected } } */
4 #include <stdio.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include <openacc.h>
9 int
10 main (int argc, char **argv)
12 const int N = 256;
13 int i;
14 unsigned char *h;
15 void *d;
17 h = (unsigned char *) malloc (N);
19 for (i = 0; i < N; i++)
21 h[i] = i;
24 d = acc_malloc (N);
26 acc_memcpy_to_device (d, h, N);
28 memset (&h[0], 0, N);
30 fprintf (stderr, "CheCKpOInT\n");
31 acc_memcpy_to_device (d, h, N << 1);
33 acc_memcpy_from_device (h, d, N);
35 for (i = 0; i < N; i++)
37 if (h[i] != i)
38 abort ();
41 acc_free (d);
43 free (h);
45 return 0;
48 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
49 /* { dg-output "invalid size" } */
50 /* { dg-shouldfail "" } */