diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/recursive_check_9.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/recursive_check_9.f90 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/recursive_check_9.f90 b/gcc/testsuite/gfortran.dg/recursive_check_9.f90 new file mode 100644 index 000000000..50af06787 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/recursive_check_9.f90 @@ -0,0 +1,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 |