1// clang-format off
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
6// clang-format on
7
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
14
15#include <omp.h>
16
17int main(void) {
18 int X;
19 omp_target_free(&X, 0);
20}
21
22// CHECK: OFFLOAD ERROR: deallocation of non-allocated device memory: 0x
23// CHECK: dataDelete
24// NDEBG: main
25// DEBUG: main {{.*}}free_host_ptr.c:20
26

source code of offload/test/sanitizer/free_host_ptr.c