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