2 // RUN: %libomptarget-compileoptxx-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-compileoptxx-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
18 void *llvm_omp_target_alloc_shared(size_t Size
, int DeviceNum
);
19 void llvm_omp_target_free_host(void *Ptr
, int DeviceNum
);
23 void *P
= llvm_omp_target_alloc_shared(8, 0);
24 llvm_omp_target_free_host(P
, 0);
28 // CHECK: OFFLOAD ERROR: deallocation requires pinned host memory but allocation was managed memory: 0x
30 // CHECK: llvm_omp_target_free_host
32 // DEBUG: main {{.*}}free_wrong_ptr_kind.cpp:25
34 // CHECK: Last allocation of size 8 -> device pointer
36 // CHECK: llvm_omp_target_alloc_shared
38 // DEBUG: main {{.*}}free_wrong_ptr_kind.cpp:24