[ELF] Replace some Fatal with Err
[llvm-project.git] / offload / test / sanitizer / kernel_crash.c
blob1406af47c7ba92d5963fa90fc7bb10aac676a13b
1 // clang-format off
2 // RUN: %libomptarget-compile-generic
3 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=TRACE,NDEBG
4 // RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
5 // RUN: %libomptarget-compile-generic -g
6 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=TRACE,DEBUG
7 // RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
8 // clang-format on
10 // UNSUPPORTED: nvptx64-nvidia-cuda
11 // UNSUPPORTED: nvptx64-nvidia-cuda-LTO
12 // UNSUPPORTED: aarch64-unknown-linux-gnu
13 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
14 // UNSUPPORTED: x86_64-unknown-linux-gnu
15 // UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
16 // UNSUPPORTED: s390x-ibm-linux-gnu
17 // UNSUPPORTED: s390x-ibm-linux-gnu-LTO
19 #include <omp.h>
21 int main(void) {
22 int *A = 0;
23 #pragma omp target
26 #pragma omp target
29 #pragma omp target
31 *A = 42;
33 #pragma omp target
37 // TRACE: Display 1 of the 3 last kernel launch traces
38 // TRACE: Kernel 0: {{.*}} (__omp_offloading_{{.*}}_main_l29)
39 // TRACE: launchKernel
40 // NDEBG: main
41 // DEBUG: main {{.*}}kernel_crash.c:29
43 // CHECK: Display last 3 kernels launched:
44 // CHECK: Kernel 0: {{.*}} (__omp_offloading_{{.*}}_main_l29)
45 // CHECK: Kernel 1: {{.*}} (__omp_offloading_{{.*}}_main_l26)
46 // CHECK: Kernel 2: {{.*}} (__omp_offloading_{{.*}}_main_l23)