1 /* PR middle-end/66199 */
3 /* { dg-options "-O2 -fopenmp" } */
5 #pragma omp declare target
6 int u
[1024], v
[1024], w
[1024];
7 #pragma omp end declare target
9 __attribute__((noinline
, noclone
)) void
13 #pragma omp target teams distribute parallel for default(none) firstprivate (a, b) shared(u, v, w)
14 for (d
= a
; d
< b
; d
++)
18 __attribute__((noinline
, noclone
)) void
19 f2 (long a
, long b
, long c
)
22 #pragma omp target teams distribute parallel for default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e)
23 for (d
= a
; d
< b
; d
++)
30 __attribute__((noinline
, noclone
)) void
31 f3 (long a1
, long b1
, long a2
, long b2
)
34 #pragma omp target teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
35 for (d1
= a1
; d1
< b1
; d1
++)
36 for (d2
= a2
; d2
< b2
; d2
++)
37 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];
40 __attribute__((noinline
, noclone
)) void
41 f4 (long a1
, long b1
, long a2
, long b2
)
44 #pragma omp target teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2)
45 for (d1
= a1
; d1
< b1
; d1
++)
46 for (d2
= a2
; d2
< b2
; d2
++)
47 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];