view gcc/testsuite/gfortran.dg/recursive_check_10.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do run }
! { dg-options "-fcheck=recursion" }
!
! PR fortran/39577
!
! OK - no recursion
program test
 integer :: i
 i = f(.false.)
 print *,i
 i = f(.false.)
 print *,i
contains
  integer function f(rec) 
    logical :: rec
    if(rec) then
      f = g()
    else
      f = 42
    end if
  end function f
  integer function g()
    g = f(.false.)
  end function g
end program test