Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.fortran/pr66199-6.f90 @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 ! { dg-do run } | |
2 ! | |
3 ! PR fortran/94690 | |
4 ! PR middle-end/66199 | |
5 | |
6 module m | |
7 implicit none | |
8 integer :: u(0:1023), v(0:1023), w(0:1023) | |
9 !$omp declare target (u, v, w) | |
10 | |
11 contains | |
12 | |
13 integer function f2 (a, b, c) | |
14 integer :: a, b, c, d, e | |
15 !$omp target map(from: d, e) | |
16 !$omp teams distribute parallel do default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e) | |
17 do d = a, b-1 | |
18 u(d) = v(d) + w(d) | |
19 e = c + d * 5 | |
20 end do | |
21 !$omp end target | |
22 f2 = d + e | |
23 end | |
24 | |
25 integer function f3 (a1, b1, a2, b2) | |
26 integer :: a1, b1, a2, b2, d1, d2 | |
27 !$omp target map(from: d1, d2) | |
28 !$omp teams distribute parallel do default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2) | |
29 do d1 = a1, b1-1 | |
30 do d2 = a2, b2-1 | |
31 u(d1 * 32 + d2) = v(d1 * 32 + d2) + w(d1 * 32 + d2) | |
32 end do | |
33 end do | |
34 !$omp end target | |
35 f3 = d1 + d2 | |
36 end | |
37 end module m | |
38 | |
39 use m | |
40 if (f2 (0, 1024, 17) /= 1024 + (17 + 5 * 1023)) stop 1 | |
41 if (f3 (0, 32, 0, 32) /= 64) stop 2 | |
42 end |