[libc] Deprecate LLVM_ENABLE_PROJECTS in favor of LLVM_ENABLE_RUNTIMES. (#117265)
[llvm-project.git] / offload / test / mapping / target_use_device_addr.c
blob5c2bb8a48f6e6ce3fe8bc2f3b8e6d45065f70fbc
1 // RUN: %libomptarget-compile-generic -fopenmp-version=51
2 // RUN: %libomptarget-run-generic 2>&1 \
3 // RUN: | %fcheck-generic
5 #include <stdio.h>
6 int main() {
7 short x[10];
8 short *xp = &x[0];
10 x[1] = 111;
12 printf("%d, %p\n", xp[1], &xp[1]);
13 #pragma omp target data use_device_addr(xp[1 : 3]) map(tofrom : x)
14 #pragma omp target is_device_ptr(xp)
15 { xp[1] = 222; }
16 // CHECK: 222
17 printf("%d, %p\n", xp[1], &xp[1]);