1 /* PR middle-end/66199 */
4 #pragma omp declare target
5 int u
[1024], v
[1024], w
[1024];
6 #pragma omp end declare target
8 __attribute__((noinline
, noclone
)) long
12 #pragma omp target map(from: d)
13 #pragma omp teams default(none) shared(a, b, d, u, v, w)
14 #pragma omp distribute simd firstprivate (a, b)
15 for (d
= a
; d
< b
; d
++)
20 __attribute__((noinline
, noclone
)) long
21 f2 (long a
, long b
, long c
)
24 #pragma omp target map(from: d, e)
25 #pragma omp teams default(none) firstprivate (a, b, c) shared(d, e, u, v, w)
26 #pragma omp distribute simd linear(d) lastprivate(e)
27 for (d
= a
; d
< b
; d
++)
35 __attribute__((noinline
, noclone
)) long
36 f3 (long a1
, long b1
, long a2
, long b2
)
39 #pragma omp target map(from: d1, d2)
40 #pragma omp teams default(none) shared(a1, b1, a2, b2, d1, d2, u, v, w)
41 #pragma omp distribute simd firstprivate (a1, b1, a2, b2) lastprivate(d1, d2) collapse(2)
42 for (d1
= a1
; d1
< b1
; d1
++)
43 for (d2
= a2
; d2
< b2
; d2
++)
44 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];
48 __attribute__((noinline
, noclone
)) long
49 f4 (long a1
, long b1
, long a2
, long b2
)
52 #pragma omp target map(from: d1, d2)
53 #pragma omp teams default(none) firstprivate (a1, b1, a2, b2) shared(d1, d2, u, v, w)
54 #pragma omp distribute simd collapse(2)
55 for (d1
= a1
; d1
< b1
; d1
++)
56 for (d2
= a2
; d2
< b2
; d2
++)
57 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];
64 if (f1 (0, 1024) != 1024
65 || f2 (0, 1024, 17) != 1024 + (17 + 5 * 1023)
66 || f3 (0, 32, 0, 32) != 64
67 || f4 (0, 32, 0, 32) != 64)