1 /* Exercise acc_update_device on unmapped data. */
2
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
4
5 #include <stdio.h>
6 #include <stdlib.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
16 h = (unsigned char *) malloc (N);
17
18 for (i = 0; i < N; i++)
19 {
20 h[i] = i;
21 }
22
23 fprintf (stderr, "CheCKpOInT\n");
24 acc_update_device (h, N);
25
26 acc_copyout (h, N);
27
28 for (i = 0; i < N; i++)
29 {
30 if (h[i] != 0xab)
31 abort ();
32 }
33
34 free (h);
35
36 return 0;
37 }
38
39 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
40 /* { dg-output "\\\[\[0-9a-fA-FxX\]+,256\\\] is not mapped" } */
41 /* { dg-shouldfail "" } */