summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/recursive_check_9.f90
blob: 50af06787fc94366eff81d220be81b5f0a62e237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { 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