[ValueTracking] Take into account whether zero is poison when computing CR for `ct...
[llvm-project.git] / offload / test / sanitizer / kernel_crash_many.c
blobf1d17ca2b76e236347eda6ef1383f48b372c7ef0
1 // clang-format off
2 // RUN: %libomptarget-compile-generic
3 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=24 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,NDEBG
4 // RUN: %libomptarget-compile-generic -g
5 // RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=16 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,DEBUG
6 // clang-format on
8 // UNSUPPORTED: nvptx64-nvidia-cuda
9 // UNSUPPORTED: nvptx64-nvidia-cuda-LTO
10 // UNSUPPORTED: aarch64-unknown-linux-gnu
11 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
12 // UNSUPPORTED: x86_64-unknown-linux-gnu
13 // UNSUPPORTED: x86_64-unknown-linux-gnu-LTO
14 // UNSUPPORTED: s390x-ibm-linux-gnu
15 // UNSUPPORTED: s390x-ibm-linux-gnu-LTO
17 #include <omp.h>
19 int main(void) {
20 int *A = 0;
21 for (int i = 0; i < 10; ++i) {
22 #pragma omp target
26 #pragma omp target
28 *A = 42;
31 // CHECK: Display 8 of the 8 last kernel launch traces
32 // CHECK: Kernel 0: {{.*}} (__omp_offloading_{{.*}}_main_l26)
33 // CHECK: launchKernel
34 // NDEBG: main
35 // DEBUG: main {{.*}}kernel_crash_many.c:26
37 // CHECK: Kernel 1: {{.*}} (__omp_offloading_{{.*}}_main_l22)
38 // CHECK: launchKernel
39 // NDEBG: main
40 // DEBUG: main {{.*}}kernel_crash_many.c:
42 // CHECK: Kernel 2: {{.*}} (__omp_offloading_{{.*}}_main_l22)
43 // CHECK: launchKernel
44 // NDEBG: main
45 // DEBUG: main {{.*}}kernel_crash_many.c:
47 // CHECK: Kernel 3: {{.*}} (__omp_offloading_{{.*}}_main_l22)
48 // CHECK: launchKernel
49 // NDEBG: main
50 // DEBUG: main {{.*}}kernel_crash_many.c:
52 // CHECK: Kernel 4: {{.*}} (__omp_offloading_{{.*}}_main_l22)
53 // CHECK: launchKernel
54 // NDEBG: main
55 // DEBUG: main {{.*}}kernel_crash_many.c:
57 // CHECK: Kernel 5: {{.*}} (__omp_offloading_{{.*}}_main_l22)
58 // CHECK: launchKernel
59 // NDEBG: main
60 // DEBUG: main {{.*}}kernel_crash_many.c:
62 // CHECK: Kernel 6: {{.*}} (__omp_offloading_{{.*}}_main_l22)
63 // CHECK: launchKernel
64 // NDEBG: main
65 // DEBUG: main {{.*}}kernel_crash_many.c:
67 // CHECK: Kernel 7: {{.*}} (__omp_offloading_{{.*}}_main_l22)
68 // CHECK: launchKernel
69 // NDEBG: main
70 // DEBUG: main {{.*}}kernel_crash_many.c:
72 // CHECK-NOT: Kernel {{[[0-9]]+}}: