Add support for ARMv8-R architecture
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-62.c
blobace4b058b9b4a9002eb60ea44664f8a81223f6f1
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_to_device (d, h, N << 1);
32 acc_memcpy_from_device (h, d, N);
34 for (i = 0; i < N; i++)
36 if (h[i] != i)
37 abort ();
40 acc_free (d);
42 free (h);
44 return 0;
47 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
48 /* { dg-output "invalid size" } */
49 /* { dg-shouldfail "" } */