! { dg-do compile }
! { dg-options "-Wall" }
!
! PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module m

  implicit none
  private :: s1,s2,s3

contains

  subroutine s1            ! { dg-warning "defined but not used" }
    call s2(s3)
  end subroutine

  subroutine s2(dummy)     ! { dg-warning "Unused dummy argument" }
    procedure() :: dummy
  end subroutine

  subroutine s3()
  end subroutine

end module

! { dg-final { cleanup-modules "m" } }
