PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-63.c
bloba3fa728510f887abb737db3c086f7e1565ed92ee
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 fprintf (stderr, "CheCKpOInT\n");
26 acc_memcpy_to_device (0, h, N);
28 memset (&h[0], 0, N);
30 acc_memcpy_from_device (h, d, 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 "" } */