Files
clang-p2996/offload/test/sanitizer/kernel_crash_async.c
Johannes Doerfert 1739ba9bb5 [OpenMP][FIX] Adjust test to be non-flaky (#122331)
The test runs asynchronous kernels and depending on the timing the
output is slightly different. We now only check for the common parts of
the output.
2025-01-09 11:57:11 -08:00

40 lines
1.3 KiB
C

// clang-format off
// RUN: %libomptarget-compileopt-generic
// 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
// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
// RUN: %libomptarget-compileopt-generic -g
// 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
// RUN: %not --crash %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK
// clang-format on
// UNSUPPORTED: nvptx64-nvidia-cuda
// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
// UNSUPPORTED: aarch64-unknown-linux-gnu
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
// UNSUPPORTED: x86_64-unknown-linux-gnu
// UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
// UNSUPPORTED: s390x-ibm-linux-gnu
// UNSUPPORTED: s390x-ibm-linux-gnu-LTO
#include <omp.h>
int main(void) {
int *A = 0;
#pragma omp target nowait
{
}
#pragma omp target nowait
{
}
#pragma omp target nowait
{
*A = 42;
}
#pragma omp taskwait
}
// TRACE: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l29)
// TRACE: launchKernel
//
// CHECK: Kernel {{.*}} (__omp_offloading_{{.*}}_main_l29)