7 int a
[N
], b
[N
], c
[N
], d
[N
];
9 for (int i
= 0; i
< N
; i
++) {
15 #pragma omp target enter data map (alloc: c, d) map(to: a)
16 #pragma omp target map (present, always, to: d)
17 for (int i
= 0; i
< N
; i
++)
21 /* a has already been mapped and 'c' allocated so this should be okay. */
22 #pragma omp target map (present, to: a) map(present, always, from: c)
23 for (int i
= 0; i
< N
; i
++)
26 for (int i
= 0; i
< N
; i
++)
30 fprintf (stderr
, "CheCKpOInT\n");
31 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
33 /* b has not been allocated, so this should result in an error. */
34 /* { dg-output "libgomp: present clause: not present on the device \\(addr: 0x\[0-9a-f\]+, size: \[0-9\]+ \\(0x\[0-9a-f\]+\\), dev: \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
35 /* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
36 #pragma omp target map (present, to: b)
37 for (int i
= 0; i
< N
; i
++)
39 #pragma omp target exit data map (from: c)