]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.c/pr66199-5.c
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 distribute parallel for simd default(none) firstprivate (a, b) shared(u, v, w)
14 for (d
= a
; d
< b
; d
++)
19 __attribute__((noinline
, noclone
)) long
20 f2 (long a
, long b
, long c
)
23 #pragma omp target map(from: d, e)
24 #pragma omp teams distribute parallel for simd default(none) firstprivate (a, b, c) shared(u, v, w) linear(d) lastprivate(e)
25 for (d
= a
; d
< b
; d
++)
33 __attribute__((noinline
, noclone
)) long
34 f3 (long a1
, long b1
, long a2
, long b2
)
37 #pragma omp target map(from: d1, d2)
38 #pragma omp teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
39 for (d1
= a1
; d1
< b1
; d1
++)
40 for (d2
= a2
; d2
< b2
; d2
++)
41 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];
45 __attribute__((noinline
, noclone
)) long
46 f4 (long a1
, long b1
, long a2
, long b2
)
49 #pragma omp target map(from: d1, d2)
50 #pragma omp teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2)
51 for (d1
= a1
; d1
< b1
; d1
++)
52 for (d2
= a2
; d2
< b2
; d2
++)
53 u
[d1
* 32 + d2
] = v
[d1
* 32 + d2
] + w
[d1
* 32 + d2
];
60 if (f1 (0, 1024) != 1024
61 || f2 (0, 1024, 17) != 1024 + (17 + 5 * 1023)
62 || f3 (0, 32, 0, 32) != 64
63 || f4 (0, 32, 0, 32) != 64)