Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / mapping / target_wrong_use_device_addr.c
blobbb5a1d44031a3f89860d8ae70ec538687f03c168
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
5 #include <stdio.h>
7 int main() {
8 float arr[10];
9 float *x = &arr[0];
11 // CHECK: host addr=0x[[#%x,HOST_ADDR:]]
12 fprintf(stderr, "host addr=%p\n", x);
14 #pragma omp target data map(to : x [0:10])
16 // CHECK: Libomptarget device 0 info: variable x does not have a valid device
17 // counterpart
18 #pragma omp target data use_device_addr(x)
20 // CHECK-NOT: device addr=0x[[#%x,HOST_ADDR:]]
21 fprintf(stderr, "device addr=%p\n", x);
25 return 0;