1 /* Verify that we refuse 'acc_free', after '#pragma acc enter data create'. */
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 ()
11 {
12 const int N = 108;
13
14 char *h = (char *) malloc (N);
15 #pragma acc enter data create (h[0:N - 3])
16 void *d = acc_deviceptr (h);
17 if (!d)
18 abort ();
19
20 fprintf (stderr, "CheCKpOInT\n");
21 acc_free (d);
22
23 return 0;
24 }
25
26 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" }
27 { dg-output "refusing to free device memory space at \[0-9a-fA-FxX\]+ that is still mapped at \\\[\[0-9a-fA-FxX\]+,\\\+105\\\]" }
28 { dg-shouldfail "" } */