Retro68/gcc/libgomp/testsuite/libgomp.fortran/pr66199-1.f90

50 lines
1.2 KiB
Fortran
Raw Normal View History

2015-08-28 15:33:40 +00:00
! PR middle-end/66199
! { dg-do run }
2018-12-28 15:30:48 +00:00
! { dg-options "-O2" }
2015-08-28 15:33:40 +00:00
integer :: u(1024), v(1024), w(1024), a, b, c, d, e, a1, b1, a2, b2, d1, d2
a = 1
b = 1024
d = 75
!$omp parallel do simd default(none) firstprivate (a, b) shared(u, v, w)
do d = a, b
u(d) = v(d) + w(d)
end do
2018-12-28 15:30:48 +00:00
if (d .ne. 1025) STOP 1
2015-08-28 15:33:40 +00:00
c = 17
d = 75
!$omp parallel do simd default(none) firstprivate (a, b) shared(u, v, w) &
!$omp& linear(d) linear(c:5) lastprivate(e)
do d = a, b
u(d) = v(d) + w(d)
c = c + 5
e = c
end do
2018-12-28 15:30:48 +00:00
if (d .ne. 1025 .or. c .ne. (17 + 5 * 1024)) STOP 2
if (e .ne. (17 + 5 * 1024)) STOP 3
2015-08-28 15:33:40 +00:00
a1 = 0
a2 = 0
b1 = 31
b2 = 31
d1 = 7
d2 = 9
!$omp parallel do simd default(none) firstprivate (a1, b1, a2, b2) &
!$omp& shared(u, v, w) lastprivate(d1, d2) collapse(2)
do d1 = a1, b1
do d2 = a2, b2
u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1)
end do
end do
2018-12-28 15:30:48 +00:00
if (d1 .ne. 32 .or. d2 .ne. 32) STOP 4
2015-08-28 15:33:40 +00:00
d1 = 7
d2 = 9
!$omp parallel do simd default(none) firstprivate (a1, b1, a2, b2) &
!$omp& shared(u, v, w) collapse(2)
do d1 = a1, b1
do d2 = a2, b2
u(d1 * 32 + d2 + 1) = v(d1 * 32 + d2 + 1) + w(d1 * 32 + d2 + 1)
end do
end do
2018-12-28 15:30:48 +00:00
if (d1 .ne. 32 .or. d2 .ne. 32) STOP 5
2015-08-28 15:33:40 +00:00
end