gcc/libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95
Tobias Burnus a0221aeebd [OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments
* testsuite/libgomp.oacc-fortran/optional-cache.f95: Add 'dg-do run'.
        * testsuite/libgomp.oacc-fortran/optional-reduction.f90: Remove
        unnecessary 'dg-additional-options "-w"'.

From-SVN: r279217
2019-12-11 11:40:11 +01:00

25 lines
629 B
Fortran

! { dg-do run }
! Test that the cache directives work with optional arguments. The effect
! of giving a non-present argument to the cache directive is not tested as
! it is undefined. The test is based on gfortran.dg/goacc/cache-1.f95.
! { dg-additional-options "-std=f2008" }
program cache_test
implicit none
integer :: d(10), e(7,13)
call do_test(d, e)
contains
subroutine do_test(d, e)
integer, optional :: d(10), e(7,13)
integer :: i
do concurrent (i=1:5)
!$acc cache (d(1:3))
!$acc cache (d(i:i+2))
!$acc cache (e(1:3,2:4))
!$acc cache (e(i:i+2,i+1:i+3))
enddo
end
end