Retro68/gcc/libgomp/testsuite/libgomp.fortran/depend-3.f90

43 lines
1019 B
Fortran
Raw Normal View History

2014-09-21 17:33:12 +00:00
! { dg-do run }
integer :: x(2, 3)
integer, allocatable :: z(:, :)
allocate (z(-2:3, 2:4))
call foo (x, z)
contains
subroutine foo (x, z)
integer :: x(:, :), y
integer, allocatable :: z(:, :)
y = 1
!$omp parallel shared (x, y, z)
!$omp single
!$omp taskgroup
!$omp task depend(in: x)
2018-12-28 15:30:48 +00:00
if (y.ne.1) STOP 1
2014-09-21 17:33:12 +00:00
!$omp end task
!$omp task depend(out: x(1:2, 1:3))
y = 2
!$omp end task
!$omp end taskgroup
!$omp taskgroup
!$omp task depend(in: z)
2018-12-28 15:30:48 +00:00
if (y.ne.2) STOP 2
2014-09-21 17:33:12 +00:00
!$omp end task
!$omp task depend(out: z(-2:3, 2:4))
y = 3
!$omp end task
!$omp end taskgroup
!$omp taskgroup
!$omp task depend(in: x)
2018-12-28 15:30:48 +00:00
if (y.ne.3) STOP 3
2014-09-21 17:33:12 +00:00
!$omp end task
!$omp task depend(out: x(1:, 1:))
y = 4
!$omp end task
!$omp end taskgroup
!$omp end single
!$omp end parallel
2018-12-28 15:30:48 +00:00
if (y.ne.4) STOP 4
2014-09-21 17:33:12 +00:00
end subroutine
end