blob: 50af06787fc94366eff81d220be81b5f0a62e237 [file] [log] [blame]
! { dg-do run }
! { dg-options "-fcheck=recursion" }
! { dg-shouldfail "Recursion check" }
!
! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'f'" }
!
! PR fortran/39577
!
! Invalid - recursion
program test
call f(.false.)
call f(.true.)
contains
subroutine f(rec)
logical :: rec
if(rec) then
call g()
end if
return
end subroutine f
subroutine g()
call f(.false.)
return
end subroutine g
end program test