To enable Flang testing on Windows, shell scripts have to be ported to Python. In this patch the "test_errors.sh" script is ported to python ("test_errors.py"). The RUN line of existing tests was changed to make use of the python script.
Used python regex in place of awk/sed.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D107575
44 lines
1.0 KiB
Fortran
44 lines
1.0 KiB
Fortran
! RUN: %python %S/../test_errors.py %s %flang -fopenacc
|
|
|
|
! Check OpenACC clause validity for the following construct and directive:
|
|
! 2.10 Cache
|
|
|
|
program openacc_cache_validity
|
|
|
|
implicit none
|
|
|
|
type atype
|
|
real(8), dimension(10) :: arr
|
|
real(8) :: s
|
|
end type atype
|
|
|
|
integer :: i
|
|
integer, parameter :: N = 256
|
|
real(8), dimension(N, N) :: aa
|
|
type(atype) :: t
|
|
type(atype), dimension(10) :: ta
|
|
real(8), dimension(N) :: a
|
|
|
|
!$acc cache(a(i))
|
|
!$acc cache(a(1:2,3:4))
|
|
!$acc cache(a)
|
|
!$acc cache(readonly: a, aa)
|
|
!$acc cache(readonly: a(i), aa(i, i))
|
|
!$acc cache(t%arr)
|
|
!$acc cache(ta(1:2)%arr)
|
|
!$acc cache(ta(1:2)%arr(1:4))
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
!$acc cache(ta(1:2)%s)
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
!$acc cache(i)
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
!$acc cache(t%s)
|
|
|
|
!ERROR: Only array element or subarray are allowed in CACHE directive
|
|
!$acc cache(/i/)
|
|
|
|
end program openacc_cache_validity
|