| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenacc |
| 2 |
|
| 3 |
! Check OpenACC clause validity for the following construct and directive: |
| 4 |
! 2.15.1 routine |
| 5 |
|
| 6 |
module openacc_routine_validity |
| 7 |
implicit none |
| 8 |
|
| 9 |
!$acc routine(sub3) seq |
| 10 |
|
| 11 |
!$acc routine(fct2) vector |
| 12 |
|
| 13 |
!$acc routine(sub3) |
| 14 |
|
| 15 |
!ERROR: ROUTINE directive without name must appear within the specification part of a subroutine or function definition, or within an interface body for a subroutine or function in an interface block |
| 16 |
!$acc routine seq |
| 17 |
|
| 18 |
!$acc routine(dummy) seq |
| 19 |
|
| 20 |
contains |
| 21 |
|
| 22 |
subroutine sub1(a) |
| 23 |
real :: a(:) |
| 24 |
!$acc routine |
| 25 |
end subroutine sub1 |
| 26 |
|
| 27 |
subroutine sub2(a) |
| 28 |
real :: a(:) |
| 29 |
!ERROR: Clause NOHOST is not allowed after clause DEVICE_TYPE on the ROUTINE directive |
| 30 |
!$acc routine seq device_type(*) nohost |
| 31 |
end subroutine sub2 |
| 32 |
|
| 33 |
subroutine sub3(a) |
| 34 |
real :: a(:) |
| 35 |
end subroutine sub3 |
| 36 |
|
| 37 |
subroutine sub4(a) |
| 38 |
real :: a(:) |
| 39 |
!$acc routine seq |
| 40 |
end subroutine sub4 |
| 41 |
|
| 42 |
subroutine sub5(a) |
| 43 |
real :: a(:) |
| 44 |
!$acc routine(sub5) seq |
| 45 |
end subroutine sub5 |
| 46 |
|
| 47 |
function fct1(a) |
| 48 |
integer :: fct1 |
| 49 |
real :: a(:) |
| 50 |
!$acc routine vector nohost |
| 51 |
end function fct1 |
| 52 |
|
| 53 |
function fct2(a) |
| 54 |
integer :: fct2 |
| 55 |
real :: a(:) |
| 56 |
end function fct2 |
| 57 |
|
| 58 |
function fct3(a) |
| 59 |
integer :: fct3 |
| 60 |
real :: a(:) |
| 61 |
!$acc routine seq bind(fct2) |
| 62 |
end function fct3 |
| 63 |
|
| 64 |
function fct4(a) |
| 65 |
integer :: fct4 |
| 66 |
real :: a(:) |
| 67 |
!$acc routine seq bind("_fct4") |
| 68 |
end function fct4 |
| 69 |
|
| 70 |
subroutine sub6(a) |
| 71 |
real :: a(:) |
| 72 |
!$acc routine seq bind(dummy_sub) |
| 73 |
end subroutine sub6 |
| 74 |
|
| 75 |
end module openacc_routine_validity |