9 /* NOTE: This test is the same as array-of-struct-1.c, except the fields of
10 this struct are in a different order. */
19 foo (struct Z
*zarr
, int len
)
21 #pragma omp target map(to:zarr, zarr[5].ptr) map(tofrom:zarr[5].ptr[0:len])
23 for (int i
= 0; i
< len
; i
++)
27 #pragma omp target map(to:zarr) map(tofrom:zarr[4].arr[0:len])
29 for (int i
= 0; i
< len
; i
++)
33 #pragma omp target map (to:zarr[3].ptr) map(tofrom:zarr[3].ptr[0:len])
35 for (int i
= 0; i
< len
; i
++)
39 #pragma omp target map(tofrom:zarr[2].arr[0:len])
41 for (int i
= 0; i
< len
; i
++)
46 int main (int argc
, char *argv
[])
49 memset (zs
, 0, sizeof zs
);
51 for (int i
= 0; i
< 10; i
++)
52 zs
[i
].ptr
= (int *) calloc (N
, sizeof (int));
56 for (int i
= 0; i
< N
; i
++)
58 assert (zs
[2].arr
[i
] == 1);
59 assert (zs
[4].arr
[i
] == 1);
60 assert (zs
[3].ptr
[i
] == 1);
61 assert (zs
[5].ptr
[i
] == 1);