Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / mapping / data_absent_at_exit.c
blob5baaf933b28307a0cebe8fc278d5e8593d1fd7d6
1 // RUN: %libomptarget-compile-run-and-check-generic
3 #include <stdio.h>
5 // OpenMP 5.1, sec. 2.21.7.1 "map Clause", p. 351 L14-16:
6 // "If the map clause appears on a target, target data, or target exit data
7 // construct and a corresponding list item of the original list item is not
8 // present in the device data environment on exit from the region then the
9 // list item is ignored."
11 int main(void) {
12 int f = 5, r = 6, d = 7, af = 8;
14 // Check exit from omp target data.
15 // CHECK: f = 5, af = 8
16 #pragma omp target data map(from : f) map(always, from : af)
18 #pragma omp target exit data map(delete : f, af)
19 } printf("f = %d, af = %d\n", f, af);
21 // Check omp target exit data.
22 // CHECK: f = 5, r = 6, d = 7, af = 8
23 #pragma omp target exit data map(from : f) map(release : r) map(delete : d) \
24 map(always, from : af)
25 printf("f = %d, r = %d, d = %d, af = %d\n", f, r, d, af);
27 return 0;