1// clang-format off
2// RUN: %libomptarget-compileopt-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
4// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
5// RUN: %libomptarget-compileopt-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
7// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
8// clang-format on
9
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
18
19#include <omp.h>
20
21int main(void) {
22 int *A = 0;
23#pragma omp target nowait
24 {
25 }
26#pragma omp target nowait
27 {
28 }
29#pragma omp target nowait
30 {
31 *A = 42;
32 }
33#pragma omp taskwait
34}
35
36// TRACE: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l29)
37// TRACE: launchKernel
38//
39// CHECK: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l29)
40

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