PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-68.c
blobf10903443d8f132405a8993a51f55fb056779e75
1 /* { dg-do run { target openacc_nvidia_accel_selected } } */
3 #include <stdio.h>
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_malloc (N);
25 acc_memcpy_to_device (d, h, N);
27 memset (&h[0], 0, N);
29 fprintf (stderr, "CheCKpOInT\n");
30 acc_memcpy_from_device (h, 0, N);
32 for (i = 0; i < N; i++)
34 if (h[i] != i)
35 abort ();
38 acc_free (d);
40 free (h);
42 return 0;
45 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
46 /* { dg-output "invalid device address" } */
47 /* { dg-shouldfail "" } */