Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / mapping / present / target_exit_data_delete.c
blob0fb812b2998f93e5f1212cbc1e73900c9ce4860b
1 // RUN: %libomptarget-compile-generic
2 // RUN: %libomptarget-run-fail-generic 2>&1 \
3 // RUN: | %fcheck-generic
5 #include <stdio.h>
7 int main() {
8 int i;
10 // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
11 fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
13 // CHECK-NOT: omptarget
14 #pragma omp target enter data map(alloc : i)
15 #pragma omp target exit data map(present, delete : i)
17 // CHECK: i was present
18 fprintf(stderr, "i was present\n");
20 // CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
21 // CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory
22 #pragma omp target exit data map(present, delete : i)
24 // CHECK-NOT: i was present
25 fprintf(stderr, "i was present\n");
27 return 0;