1 // RUN: %libomptarget-compilexx-and-run-generic
2 // RUN: %libomptarget-compileoptxx-and-run-generic
7 constexpr const int N
= 10;
19 int main(int argc
, char *argv
[]) {
22 for (int i
= 0; i
< N
; ++i
) {
26 #pragma omp target enter data map(to : s, s.t.p[ : N])
30 for (int i
= 0; i
< N
; ++i
) {
35 #pragma omp target update from(s.t.p[ : N])
37 for (int i
= 0; i
< N
; ++i
) {
38 assert(s
.t
.p
[i
] == 2 * i
);
42 #pragma omp target update to(s.t.p[ : N])
46 for (int i
= 0; i
< N
; ++i
) {
51 #pragma omp target exit data map(from : s, s.t.p[ : N])
53 for (int i
= 0; i
< N
; ++i
) {
54 assert(s
.t
.p
[i
] == 4 * i
);