1! { dg-do compile }
2! Some tests for PROCEDURE declarations inside of interfaces.
3! Contributed by Janus Weil <jaydub66@gmail.com>
4
5module m
6
7  interface
8    subroutine a()
9    end subroutine a
10  end interface
11
12  procedure(c) :: f
13
14  interface bar
15    procedure a,d
16  end interface bar
17
18  interface foo
19    procedure c
20  end interface foo
21
22  abstract interface
23    procedure f  ! { dg-error "must be in a generic interface" }
24  end interface
25
26  interface
27    function opfoo(a)
28      integer,intent(in) :: a
29      integer :: opfoo
30    end function opfoo
31  end interface
32
33  interface operator(.op.)
34    procedure opfoo
35  end interface
36
37  external ex  ! { dg-error "has no explicit interface" }
38  procedure():: ip  ! { dg-error "has no explicit interface" }
39  procedure(real):: pip  ! { dg-error "has no explicit interface" }
40
41  interface nn1
42    procedure ex
43    procedure a, a  ! { dg-error "already present in the interface" }
44  end interface
45
46  interface nn2
47    procedure ip
48  end interface
49
50  interface nn3
51    procedure pip
52  end interface
53
54contains
55
56 subroutine d(x)
57
58   interface
59     subroutine x()
60     end subroutine x
61   end interface
62
63   interface gen
64     procedure x
65   end interface
66
67 end subroutine d
68
69 function c(x)
70   integer :: x
71   real :: c
72   c = 3.4*x
73 end function c
74
75end module m
76