[ELF] Replace some Fatal with Err
[llvm-project.git] / offload / test / sanitizer / kernel_trap.c
blob91c4c7229159bca3637e4b8cdd9a45d04d1d1c03
2 // clang-format off
3 // RUN: %libomptarget-compile-generic
4 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,TRACE,NDEBG
5 // RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
6 // RUN: %libomptarget-compile-generic -g
7 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,TRACE,DEBUG
8 // RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
9 // clang-format on
11 // UNSUPPORTED: nvptx64-nvidia-cuda
12 // UNSUPPORTED: nvptx64-nvidia-cuda-LTO
13 // UNSUPPORTED: aarch64-unknown-linux-gnu
14 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
15 // UNSUPPORTED: x86_64-unknown-linux-gnu
16 // UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
17 // UNSUPPORTED: s390x-ibm-linux-gnu
18 // UNSUPPORTED: s390x-ibm-linux-gnu-LTO
20 #include <omp.h>
22 int main(void) {
24 #pragma omp target
27 #pragma omp target
30 #pragma omp target
32 __builtin_trap();
34 #pragma omp target
38 // clang-format off
39 // CHECK: OFFLOAD ERROR: Kernel 'omp target in main @ 30 (__omp_offloading_{{.*}}_main_l30)'
40 // CHECK: OFFLOAD ERROR: execution interrupted by hardware trap instruction
41 // TRACE: launchKernel
42 // NDEBG: main
43 // DEBUG: main {{.*}}kernel_trap.c:
44 // clang-format on