Files
clang-p2996/openmp/libomptarget/test/mapping/alloc_fail.c
Johannes Doerfert 5d57041d39 [OpenMP][NFC] Move debug declares into CMAKE out of "private.h" (#73732)
Everywhere else we define this in the CMakeLists.txt and "private.h"
needs to go. Rename "Libomptarget" into "omptarget", no benefit from
"lib".
2023-11-28 17:38:49 -08:00

16 lines
636 B
C

// RUN: %libomptarget-compile-generic
// RUN: %libomptarget-run-fail-generic 2>&1 \
// RUN: | %fcheck-generic
// CHECK: omptarget message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
// CHECK: omptarget error: Call to getTargetPointer returned null pointer (device failure or illegal mapping).
// CHECK: omptarget 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;
}