OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / recursive_check_9.f90
1 ! { dg-do run }
2 ! { dg-options "-fcheck=recursion" }
3 ! { dg-shouldfail "Recursion check" }
4 !
5 ! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'f'" }
6 !
7 ! PR fortran/39577
8 !
9 ! Invalid - recursion
10 program test
11  call f(.false.)
12  call f(.true.)
13 contains
14   subroutine f(rec) 
15     logical :: rec
16     if(rec) then
17       call g()
18     end if
19     return
20   end subroutine f
21   subroutine g()
22     call f(.false.)
23     return
24   end subroutine g
25 end program test