1! { dg-do compile }
2! PR 55593 - bogus error with generic subroutines
3module foo
4  implicit none
5  interface sub
6     subroutine sub2(i)
7       integer, intent(in) :: i
8     end subroutine sub2
9     subroutine sub(i)
10       integer, dimension(:), intent(out) :: i
11     end subroutine sub
12  end interface sub
13
14  interface tub2
15     subroutine tub2(i)
16       integer, intent(in) :: i
17     end subroutine tub2
18     subroutine tub(i)
19       integer, dimension(:), intent(out) :: i
20     end subroutine tub
21  end interface tub2
22
23  interface func
24     integer function ifunc(i)
25       integer, intent(in) :: i
26     end function ifunc
27     integer function func(i)
28       integer, intent(in) :: i(:)
29     end function func
30  end interface func
31
32  interface igunc
33     integer function igunc(i)
34       integer, intent(in) :: i
35     end function igunc
36     integer function gunc(i)
37       integer, intent(in) :: i(:)
38     end function gunc
39  end interface igunc
40end module foo
41
42program main
43  use foo
44  implicit none
45  integer :: i
46  do i=1,10
47     call sub(i)
48     call tub2(i)
49  end do
50  do i=1,10
51     print *,func(i)
52     print *,igunc(i)
53  end do
54
55  do undeclared=1,10        ! { dg-error "has no IMPLICIT type" }
56     call sub(undeclared)
57  end do
58end program main
59