1// RUN: %libomptarget-compile-generic -fopenmp-version=51 -g
2// RUN: env LIBOMPTARGET_INFO=64 %libomptarget-run-fail-generic 2>&1 \
3// RUN: | %fcheck-generic
4
5// FIXME: Fails due to optimized debugging in 'ptxas'
6// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
7
8#include <stdio.h>
9
10int main() {
11 float arr[10];
12 float *x = &arr[0];
13
14 // CHECK: host addr=0x[[#%x,HOST_ADDR:]]
15 fprintf(stderr, format: "host addr=%p\n", x);
16
17#pragma omp target data map(to : x [0:10])
18 {
19// CHECK: omptarget device 0 info: variable x does not have a valid device
20// counterpart
21#pragma omp target data use_device_addr(x)
22 {
23 // CHECK-NOT: device addr=0x[[#%x,HOST_ADDR:]]
24 fprintf(stderr, format: "device addr=%p\n", x);
25 }
26 }
27
28 return 0;
29}
30
31

source code of offload/test/mapping/target_wrong_use_device_addr.c