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