[ValueTracking] Take into account whether zero is poison when computing CR for `ct...
[llvm-project.git] / offload / test / sanitizer / free_wrong_ptr_kind.c
blobaeec00162f603874e58eeba6fa97b37b8e1a9103
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
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 void *llvm_omp_target_alloc_host(size_t Size, int DeviceNum);
19 int main(void) {
20 void *P = llvm_omp_target_alloc_host(8, 0);
21 omp_target_free(P, 0);
24 // clang-format off
25 // CHECK: OFFLOAD ERROR: deallocation requires device memory but allocation was pinned host memory: 0x
26 // CHECK: dataDelete
27 // CHECK: omp_target_free
28 // NDEBG: main
29 // DEBUG: main {{.*}}free_wrong_ptr_kind.c:22
31 // CHECK: Last allocation of size 8 -> device pointer
32 // CHECK: dataAlloc
33 // CHECK: llvm_omp_target_alloc_host
34 // NDEBG: main
35 // DEBUG: main {{.*}}free_wrong_ptr_kind.c:21