summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/recursive_check_8.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/recursive_check_8.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/recursive_check_8.f9022
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/recursive_check_8.f90 b/gcc/testsuite/gfortran.dg/recursive_check_8.f90
new file mode 100644
index 00000000000..4d83498c7e2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/recursive_check_8.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-options "-fcheck=recursion" }
+!
+! PR fortran/39577
+!
+! OK - no recursion
+program test
+ call f(.false.)
+ call f(.false.)
+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