1 // RUN: %libomptarget-compilexx-run-and-check-generic
10 #pragma omp declare mapper(id1 : C s) map(to : s.a) map(from : s.b[0 : 2])
18 #pragma omp declare mapper(default : D r) map(from : r.e) \
19 map(mapper(id1), tofrom : r.f) map(tofrom : r.g[0 : r.h])
37 printf("%d %d %4.5f %d %d %d\n", spp
[0][0].e
, spp
[0][0].f
.a
, spp
[0][0].f
.b
[1],
38 spp
[0][0].f
.b
== &x
[0] ? 1 : 0, spp
[0][0].g
[1],
39 spp
[0][0].g
== &y
[0] ? 1 : 0);
40 // CHECK: 111 222 20.00000 1 30 1
42 int spp00fa
= -1, spp00fb_r
= -1, spp00fg1
= -1, spp00fg_r
= -1;
43 __intptr_t p
= reinterpret_cast<__intptr_t
>(&x
[0]),
44 p1
= reinterpret_cast<__intptr_t
>(&y
[0]);
45 #pragma omp target map(tofrom : spp[0][0]) firstprivate(p, p1) \
46 map(from: spp00fa, spp00fb_r, spp00fg1, spp00fg_r)
48 spp00fa
= spp
[0][0].f
.a
;
49 spp00fb_r
= spp
[0][0].f
.b
== reinterpret_cast<void *>(p
) ? 1 : 0;
50 spp00fg1
= spp
[0][0].g
[1];
51 spp00fg_r
= spp
[0][0].g
== reinterpret_cast<void *>(p1
) ? 1 : 0;
52 printf("%d %d %d %d\n", spp00fa
, spp00fb_r
, spp00fg1
, spp00fg_r
);
56 spp
[0][0].f
.b
[1] = 40;
59 printf("%d %d %d %d\n", spp00fa
, spp00fb_r
, spp00fg1
, spp00fg_r
);
61 printf("%d %d %4.5f %d %d %d\n", spp
[0][0].e
, spp
[0][0].f
.a
, spp
[0][0].f
.b
[1],
62 spp
[0][0].f
.b
== &x
[0] ? 1 : 0, spp
[0][0].g
[1],
63 spp
[0][0].g
== &y
[0] ? 1 : 0);
64 // CHECK: 333 222 40.00000 1 50 1