25 lines · c
1// clang-format off2// RUN: %libomptarget-compileopt-generic3// RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_ALLOCATION_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK4// clang-format on5 6// FIXME: https://github.com/llvm/llvm-project/issues/1612657// UNSUPPORTED: nvidiagpu8//9// REQUIRES: gpu10 11#include <omp.h>12 13int main() {14 int N = (1 << 30);15 char *A = (char *)malloc(N);16#pragma omp target map(A[ : N])17 { A[N] = 3; }18 // clang-format off19// CHECK: OFFLOAD ERROR: memory access fault by GPU {{.*}} (agent 0x{{.*}}) at virtual address [[PTR:0x[0-9a-z]*]]. Reasons: {{.*}}20// CHECK: Device pointer [[PTR]] does not point into any (current or prior) host-issued allocation.21// CHECK: Closest host-issued allocation (distance 1 byte; might be by page):22// CHECK: Last allocation of size 107374182423// clang-format on24}25