1 // RUN: %libomptarget-compilexx-generic -fopenmp-version=51
2 // RUN: %libomptarget-run-generic 2>&1 \
3 // RUN: | %fcheck-generic
5 // FIXME: This is currently broken on all GPU targets
6 // UNSUPPORTED: amdgcn-amd-amdhsa
7 // UNSUPPORTED: nvptx64-nvidia-cuda
8 // UNSUPPORTED: nvptx64-nvidia-cuda-LTO
16 *t1d
= (int *)malloc(3 * sizeof(int));
19 for (j
= 0; j
< 3; j
++)
21 #pragma omp target map(tofrom : (*t1d)[0 : 3])
24 printf("%d\n", (*t1d
)[1]);
25 #pragma omp target map(tofrom : (**t2d)[0 : 3])
28 printf("%d\n", (**t2d
)[1]);
29 #pragma omp target map(tofrom : (***t3d)[0 : 3])
32 printf("%d\n", (***t3d
)[1]);
33 #pragma omp target map(tofrom : (**t1d))
36 printf("%d\n", (*t1d
)[0]);
37 #pragma omp target map(tofrom : (*(*(t1d + a) + b)))
38 { *(*(t1d
+ a
) + b
) = 5; }
40 printf("%d\n", *(*(t1d
+ a
) + b
));
49 for (int i
= 0; i
< 3; i
++) {
52 #pragma omp target map((**a)[ : 3])
56 printf("%d\n", (**a
)[1]);
69 void zoo(int **f
, SSA
*sa
) {
71 f
= (int **)malloc(sa
->i
* 4 * sizeof(int));
72 t
= (int *)malloc(sa
->i
* sizeof(int));
74 *(sa
->sa
->i
+ *(f
+ sa
->i
+ 1)) = 4;
75 printf("%d\n", *(sa
->sa
->i
+ *(1 + sa
->i
+ f
)));
76 #pragma omp target map(sa, *(sa->sa->i + *(1 + sa->i + f)))
77 { *(sa
->sa
->i
+ *(1 + sa
->i
+ f
)) = 7; }
79 printf("%d\n", *(sa
->sa
->i
+ *(1 + sa
->i
+ f
)));
89 *x
= (int *)malloc(2 * sizeof(int));
90 #pragma omp target map(**x)
96 #pragma omp target map(*(*x + 1))
100 printf("%d\n", *(*x
+ 1));