1 // RUN: %libomptarget-compilexx-generic -O3 && %libomptarget-run-generic
5 // CHECK: rx: 16, ry: 16;
6 // CHECK: rx: 16, ry: 16;
7 // CHECK: rx: 16, ry: 16;
8 // CHECK: rx: 16, ry: 16;
10 template <bool Aligned
> void test() {
11 printf("Test %saligned firstprivate\n", Aligned
? "" : "non-");
12 char z1
[3 + Aligned
], z2
[3 + Aligned
];
15 y
[0] = y
[1] = y
[2] = y
[3] = 4;
16 x
[0] = x
[1] = x
[2] = x
[3] = 4;
18 #pragma omp target firstprivate(z1, y, z2) map(from : ry, rx) map(to : x)
20 ry
= (y
[0] + y
[1] + y
[2] + y
[3]);
21 rx
= (x
[0] + x
[1] + x
[2] + x
[3]);
23 printf(" rx:%i, ry:%i\n", rx
, ry
);
24 #pragma omp target firstprivate(z1, y, z2) map(from : ry, rx) map(to : x)
27 ry
= (y
[0] + y
[1] + y
[2] + y
[3]);
28 rx
= (x
[0] + x
[1] + x
[2] + x
[3]);
31 printf(" rx:%i, ry:%i\n", rx
, ry
);