comparison libgomp/testsuite/libgomp.fortran/pr66199-3.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 integer u(0:1024-1), v(0:1024-1), w(0:1024-1)
8 contains
9
10 integer(8) function f1 (a, b)
11 implicit none
12 integer, value :: a, b
13 integer(8) :: d
14 !$omp parallel do lastprivate (d) default(none) firstprivate (a, b) shared(u, v, w)
15 do d = a, b-1
16 u(d) = v(d) + w(d)
17 end do
18 f1 = d
19 end
20
21 integer(8) function f2 (a, b, c)
22 implicit none
23 integer, value :: a, b, c
24 integer(8) :: d, e
25 !$omp parallel do lastprivate (d) default(none) firstprivate (a, b) shared(u, v, w) linear(c:5) lastprivate(e)
26 do d = a, b-1
27 u(d) = v(d) + w(d)
28 c = c + 5
29 e = c
30 end do
31 f2 = d + c + e
32 end
33
34 integer(8) function f3 (a1, b1, a2, b2)
35 implicit none
36 integer, value :: a1, b1, a2, b2
37 integer(8) d1, d2
38 !$omp parallel do default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
39 do d1 = a1, b1-1
40 do d2 = a2, b2-1
41 u(d1 * 32 + d2) = v(d1 * 32 + d2) + w(d1 * 32 + d2)
42 end do
43 end do
44 f3 = d1 + d2
45 end
46 end module m
47
48 program main
49 use m
50 if (f1 (0, 1024) /= 1024) stop 1
51 if (f2 (0, 1024, 17) /= 1024 + 2 * (17 + 5 * 1024)) stop 2
52 if (f3 (0, 32, 0, 32) /= 64) stop 3
53 end program main