mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 06:56:44 +00:00
37 lines
899 B
Fortran
37 lines
899 B
Fortran
![]() |
! RUN: %S/../test_errors.sh %s %t %f18 -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
|
||
|
|
||
|
!$acc host_data use_device(aa, bb) if(.true.) if_present
|
||
|
!$acc end host_data
|
||
|
|
||
|
!$acc host_data use_device(aa, bb) if(.true.) if(ifCondition)
|
||
|
!$acc end host_data
|
||
|
|
||
|
end program openacc_host_data_validity
|