brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ecb8610 Raw
83 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenacc2 3! Check OpenACC clause validity for the following construct and directive:4!   2.15.1 routine5 6module openacc_routine_validity7  implicit none8 9  !$acc routine(sub3) seq10 11  !$acc routine(fct2) vector12 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 block16  !$acc routine seq17 18  !$acc routine(dummy) seq19 20contains21 22  subroutine sub1(a)23    real :: a(:)24    !$acc routine25  end subroutine sub126 27  subroutine sub2(a)28    real :: a(:)29    !ERROR: Clause NOHOST is not allowed after clause DEVICE_TYPE on the ROUTINE directive30    !$acc routine seq device_type(*) nohost31  end subroutine sub232 33  subroutine sub3(a)34    real :: a(:)35  end subroutine sub336 37  subroutine sub4(a)38    real :: a(:)39    !$acc routine seq40  end subroutine sub441 42  subroutine sub5(a)43    real :: a(:)44    !$acc routine(sub5) seq45  end subroutine sub546 47  function fct1(a)48    integer :: fct149    real :: a(:)50    !$acc routine vector nohost51  end function fct152 53  function fct2(a)54    integer :: fct255    real :: a(:)56  end function fct257 58  function fct3(a)59    integer :: fct360    real :: a(:)61    !$acc routine seq bind(fct2)62  end function fct363 64  function fct4(a)65    integer :: fct466    real :: a(:)67    !$acc routine seq bind("_fct4")68  end function fct469 70  subroutine sub6(a)71    real :: a(:)72    !$acc routine seq bind(dummy_sub)73  end subroutine sub674 75  subroutine sub7(a)76    real :: a(:)77    !ERROR: SHORTLOOP clause is not allowed on the KERNELS directive78    !$acc kernels shortloop79    !$acc end kernels80  end subroutine sub781 82end module openacc_routine_validity83