2 // RUN: %libomptarget-compileopt-generic
3 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_ALLOCATION_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,NDEBG
4 // RUN: %libomptarget-compileopt-generic -g
5 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_ALLOCATION_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,DEBUG
8 // UNSUPPORTED: aarch64-unknown-linux-gnu
9 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
10 // UNSUPPORTED: x86_64-unknown-linux-gnu
11 // UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
12 // UNSUPPORTED: s390x-ibm-linux-gnu
13 // UNSUPPORTED: s390x-ibm-linux-gnu-LTO
17 void *llvm_omp_target_alloc_host(size_t Size
, int DeviceNum
);
20 void *P
= llvm_omp_target_alloc_host(8, 0);
21 omp_target_free(P
, 0);
25 // CHECK: OFFLOAD ERROR: deallocation requires device memory but allocation was pinned host memory: 0x
27 // CHECK: omp_target_free
29 // DEBUG: main {{.*}}free_wrong_ptr_kind.c:22
31 // CHECK: Last allocation of size 8 -> device pointer
33 // CHECK: llvm_omp_target_alloc_host
35 // DEBUG: main {{.*}}free_wrong_ptr_kind.c:21