jyu2 added a comment.

In D137313#3906487 <https://reviews.llvm.org/D137313#3906487>, @ABataev wrote:

> Do we have a runtime test for this? Would be good to try to test it if the 
> offloading fails and the host version is executed instead.

I have runtime test in https://reviews.llvm.org/D134268
openmp/libomptarget/test/mapping/target_has_device_addr.c where

void bar() {

  short x[10];
  short *xp = &x[0];
  
  x[1] = 111;

#pragma omp target data map(tofrom : xp [0:2]) use_device_addr(xp [0:2])
#pragma omp target has_device_addr(xp [0:2])

  {
    xp[1] = 222;
    // CHECK: 222
    printf("%d %p\n", xp[1], &xp[1]);
  }
  // CHECK: 222
  printf("%d %p\n", xp[1], &xp[1]);

}


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137313/new/

https://reviews.llvm.org/D137313

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to