1 /* { dg-do run } */
2
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <unistd.h>
7 #include <openacc.h>
8
9 int
10 main (int argc, char **argv)
11 {
12 const int N = 256;
13 int i;
14 unsigned char *h;
15 void *d;
16
17 h = (unsigned char *) malloc (N);
18
19 for (i = 0; i < N; i++)
20 {
21 h[i] = i;
22 }
23
24 fprintf (stderr, "CheCKpOInT\n");
25 d = acc_present_or_copyin (h, 0);
26 if (!d)
27 abort ();
28
29 memset (&h[0], 0, N);
30
31 acc_copyout (h, N);
32
33 for (i = 0; i < N; i++)
34 {
35 if (h[i] != i)
36 abort ();
37 }
38
39 free (h);
40
41 return 0;
42 }
43
44 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
45 /* { dg-output "\\\[\[0-9a-fA-FxX\]+,\\\+0\\\] is a bad range" } */
46 /* { dg-shouldfail "" } */