PR tree-optimization/87009
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / lib-42.c
blob30b90d49c7b4ab1651d57ceea7ade63c964f7841
1 /* Exercise acc_update_device on unmapped data on nvidia targets. */
3 /* { dg-do run { target openacc_nvidia_accel_selected } } */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <openacc.h>
9 int
10 main (int argc, char **argv)
12 const int N = 256;
13 int i;
14 unsigned char *h;
16 h = (unsigned char *) malloc (N);
18 for (i = 0; i < N; i++)
20 h[i] = i;
23 fprintf (stderr, "CheCKpOInT\n");
24 acc_update_device (h, N);
26 acc_copyout (h, N);
28 for (i = 0; i < N; i++)
30 if (h[i] != 0xab)
31 abort ();
34 free (h);
36 return 0;
39 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
40 /* { dg-output "\\\[\[0-9a-fA-FxX\]+,256\\\] is not mapped" } */
41 /* { dg-shouldfail "" } */