1! { dg-do compile }
2!
3! PR fortran/90111
4!
5! Check that OpenACC directives in everywhere in specification part,
6! i.e. it may appear before/after the use, import, implicit, and declaration
7!
8
9module m
10end module m
11
12subroutine foo0(kk)
13  use m
14  implicit none
15  integer :: jj, kk
16  !$acc routine
17end
18
19subroutine foo1()
20  use m
21  implicit none
22  !$acc routine
23  integer :: jj
24end
25
26subroutine foo2()
27  use m
28  !$acc routine
29  implicit none
30end
31
32subroutine foo3()
33  !$acc routine
34  use m
35  implicit none
36end
37
38module m2
39  interface
40    subroutine foo0(kk)
41      use m
42      import
43      implicit none
44      integer :: kk
45      !$acc routine
46    end
47    subroutine foo1()
48      use m
49      import
50      implicit none
51      !$acc routine
52    end
53    subroutine foo2()
54      use m
55      import
56      !$acc routine
57      implicit none
58    end
59    subroutine foo3()
60      use m
61      !$acc routine
62      import
63      implicit none
64    end
65    subroutine foo4()
66      use m
67      !$acc routine
68      import
69      implicit none
70    end
71  end interface
72end module m2
73
74subroutine bar0()
75  use m
76  implicit none
77  integer :: ii
78  !$acc declare copyin(ii)
79end
80
81subroutine bar1()
82  use m
83  implicit none
84  !$acc declare copyin(ii)
85  integer :: ii
86end
87
88subroutine bar2()
89  use m
90  !$acc declare copyin(ii)
91  implicit none
92  integer :: ii
93end
94
95subroutine bar3()
96  !$acc declare copyin(ii)
97  use m
98  implicit none
99  integer :: ii
100end
101