llvm-c166/offload/test/mapping/alloc_fail.c
Ivan R. Ivanov 58f386207a
[offload] Remove omptarget references from tests (#208205)
Make check lines more generic so that we can move and rename components
without breaking the tests

This is in preparation for splitting off parts of libomptarget into
libompaccsupport, which will be used by both OpenACC and OpenMP. Some
debug prints will be printed from `ompaccsupport` and not `omptarget`,
thus the need for this change.
2026-08-03 16:55:38 +02:00

15 lines
606 B
C

// RUN: %libomptarget-compile-generic
// RUN: %libomptarget-run-fail-generic 2>&1 \
// RUN: | %fcheck-generic
// CHECK: message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
// CHECK: error: Call to getTargetPointer returned null pointer (device failure or illegal mapping).
// CHECK: fatal error 1: failure of target construct while offloading is mandatory
int main() {
int arr[4] = {0, 1, 2, 3};
#pragma omp target data map(alloc : arr[0 : 2])
#pragma omp target data map(alloc : arr[1 : 2])
;
return 0;
}