* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-67.c
blobec3c2a53baf73a5a3a5b818cc13fe76dd9bfb6a9
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 (0, 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 host address" } */
47 /* { dg-shouldfail "" } */