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
42 lines
1.1 KiB
Fortran
42 lines
1.1 KiB
Fortran
! RUN: %python %S/../test_errors.py %s %flang -fopenacc
|
|
|
|
! Check OpenACC clause validity for the following construct and directive:
|
|
! 2.8 host_data
|
|
|
|
program openacc_host_data_validity
|
|
|
|
implicit none
|
|
|
|
integer, parameter :: N = 256
|
|
real(8), dimension(N, N) :: aa, bb
|
|
logical :: ifCondition = .TRUE.
|
|
|
|
!ERROR: At least one of USE_DEVICE clause must appear on the HOST_DATA directive
|
|
!$acc host_data
|
|
!$acc end host_data
|
|
|
|
!$acc host_data use_device(aa)
|
|
!$acc end host_data
|
|
|
|
!$acc host_data use_device(aa) if(.true.)
|
|
!$acc end host_data
|
|
|
|
!$acc host_data use_device(aa) if(ifCondition)
|
|
!$acc end host_data
|
|
|
|
!$acc host_data use_device(aa, bb) if_present
|
|
!$acc end host_data
|
|
|
|
!ERROR: At most one IF_PRESENT clause can appear on the HOST_DATA directive
|
|
!$acc host_data use_device(aa, bb) if_present if_present
|
|
!$acc end host_data
|
|
|
|
!$acc host_data use_device(aa, bb) if(.true.) if_present
|
|
!$acc end host_data
|
|
|
|
!ERROR: At most one IF clause can appear on the HOST_DATA directive
|
|
!$acc host_data use_device(aa, bb) if(.true.) if(ifCondition)
|
|
!$acc end host_data
|
|
|
|
end program openacc_host_data_validity
|