1 // RUN: %libomptarget-compile-generic
2 // RUN: %libomptarget-run-generic 2>&1 \
3 // RUN: | %fcheck-generic
13 #pragma omp target data map(alloc : arr[50 : 2]) // partially mapped
15 // CHECK: arr[50] must present: 1
16 fprintf(stderr
, "arr[50] must present: %d\n",
17 omp_target_is_present(&arr
[50], omp_get_default_device()));
19 // CHECK: arr[0] should not present: 0
20 fprintf(stderr
, "arr[0] should not present: %d\n",
21 omp_target_is_present(&arr
[0], omp_get_default_device()));
23 // CHECK: arr[49] should not present: 0
24 fprintf(stderr
, "arr[49] should not present: %d\n",
25 omp_target_is_present(&arr
[49], omp_get_default_device()));
27 #pragma omp target // would implicitly map with full size but already present
31 } // must treat as present (dec ref count) even though full size not present
32 } // wouldn't delete if previous ref count dec didn't happen
34 // CHECK: arr[50] still present: 0
35 fprintf(stderr
, "arr[50] still present: %d\n",
36 omp_target_is_present(&arr
[50], omp_get_default_device()));