8sa1-gcc/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-5.f90
Tobias Burnus 084dc63a02 OpenMP: Support 'lastprivate (conditional:' in Fortran
gcc/fortran/ChangeLog:

	* gfortran.h (gfc_omp_namelist): Add lastprivate_conditional.
	* openmp.c (gfc_match_omp_clauses): Handle 'conditional:'
	modifier of 'lastprivate'.
	* trans-openmp.c (gfc_omp_clause_default_ctor): Don't assert
	on OMP_CLAUSE__CONDTEMP_ and other OMP_*TEMP_.
	(gfc_trans_omp_variable_list): Handle lastprivate_conditional.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/lastprivate-conditional-1.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-2.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-3.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-4.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-5.f90: New test.
2020-07-23 17:37:35 +02:00

48 lines
873 B
Fortran

! { dg-do compile }
! { dg-options "-O2 -fopenmp -fdump-tree-ompexp" }
! { dg-final { scan-tree-dump-times "GOMP_loop_start " 3 "ompexp" } }
! { dg-final { scan-tree-dump-times "GOMP_loop_end_nowait " 3 "ompexp" } }
module m
logical r
end module m
subroutine foo (a)
use m
implicit none
logical a(:)
integer :: i
!$omp do lastprivate(conditional: r)
do i = 1, 64
if (a(i)) &
r = a(i)
end do
!$omp end do nowait
end
subroutine bar (a)
use m
implicit none
logical a(:)
integer :: i
!$omp do lastprivate(conditional: r) schedule (static, 4)
do i = 1, 64
if (a(i)) &
r = a(i)
end do
!$omp end do nowait
end
subroutine baz (a)
use m
implicit none
logical a(:)
integer :: i
!$omp do lastprivate(conditional: r) schedule (runtime)
do i = 1, 64
if (a(i)) &
r = a(i)
end do
!$omp end do nowait
end