[clang-format][NFC] Add a TypeScript test case
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-routine-validity.f90
blobecb8610d8e684591d7a3529405b04fadd54c69b7
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.15.1 routine
6 module openacc_routine_validity
7 implicit none
9 !$acc routine(sub3) seq
11 !$acc routine(fct2) vector
13 !$acc routine(sub3)
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
18 !$acc routine(dummy) seq
20 contains
22 subroutine sub1(a)
23 real :: a(:)
24 !$acc routine
25 end subroutine sub1
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
33 subroutine sub3(a)
34 real :: a(:)
35 end subroutine sub3
37 subroutine sub4(a)
38 real :: a(:)
39 !$acc routine seq
40 end subroutine sub4
42 subroutine sub5(a)
43 real :: a(:)
44 !$acc routine(sub5) seq
45 end subroutine sub5
47 function fct1(a)
48 integer :: fct1
49 real :: a(:)
50 !$acc routine vector nohost
51 end function fct1
53 function fct2(a)
54 integer :: fct2
55 real :: a(:)
56 end function fct2
58 function fct3(a)
59 integer :: fct3
60 real :: a(:)
61 !$acc routine seq bind(fct2)
62 end function fct3
64 function fct4(a)
65 integer :: fct4
66 real :: a(:)
67 !$acc routine seq bind("_fct4")
68 end function fct4
70 subroutine sub6(a)
71 real :: a(:)
72 !$acc routine seq bind(dummy_sub)
73 end subroutine sub6
75 subroutine sub7(a)
76 real :: a(:)
77 !ERROR: SHORTLOOP clause is not allowed on the KERNELS directive
78 !$acc kernels shortloop
79 !$acc end kernels
80 end subroutine sub7
82 end module openacc_routine_validity