Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-68.c
blob7fffd0b9f0b82362b7985c0c672c006546e14a43
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_from_device (h, 0, N);
33 for (i = 0; i < N; i++)
35 if (h[i] != i)
36 abort ();
39 acc_free (d);
41 free (h);
43 return 0;
46 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
47 /* { dg-output "invalid device address" } */
48 /* { dg-shouldfail "" } */