[ELF] MergeInputSection: replace Fatal with Err
[llvm-project.git] / offload / test / sanitizer / free_wrong_ptr_kind.cpp
blobb801abc37199b366550a36bd7c880982b76301f7
1 // clang-format off
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
6 // clang-format on
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
15 #include <omp.h>
17 extern "C" {
18 void *llvm_omp_target_alloc_shared(size_t Size, int DeviceNum);
19 void llvm_omp_target_free_host(void *Ptr, int DeviceNum);
22 int main(void) {
23 void *P = llvm_omp_target_alloc_shared(8, 0);
24 llvm_omp_target_free_host(P, 0);
27 // clang-format off
28 // CHECK: OFFLOAD ERROR: deallocation requires pinned host memory but allocation was managed memory: 0x
29 // CHECK: dataDelete
30 // CHECK: llvm_omp_target_free_host
31 // NDEBG: main
32 // DEBUG: main {{.*}}free_wrong_ptr_kind.cpp:25
34 // CHECK: Last allocation of size 8 -> device pointer
35 // CHECK: dataAlloc
36 // CHECK: llvm_omp_target_alloc_shared
37 // NDEBG: main
38 // DEBUG: main {{.*}}free_wrong_ptr_kind.cpp:24