brintos

brintos / llvm-project-archived public Read only

0
0
Text · 431 B · 4a9dbe2 Raw
21 lines · c
1// RUN: %libomptarget-compile-generic -fopenmp-version=512// RUN: %libomptarget-run-generic 2>&1 \3// RUN: | %fcheck-generic4 5#include <stdio.h>6int main() {7  short x[10];8  short *xp = &x[0];9 10  x[1] = 111;11 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  {16    xp[1] = 222;17  }18  // CHECK: 22219  printf("%d, %p\n", xp[1], &xp[1]);20}21