ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / recursive_check_7.f90
blobd04cd999e638c069e480b0db678cb5f981857dbe
1 ! { dg-do run }
2 ! { dg-options "-fcheck=recursion" }
3 ! { dg-shouldfail "Recursion check" }
5 ! PR fortran/32626
6 ! Recursion run-time check
9 subroutine NormalFunc()
10 end subroutine NormalFunc
12 recursive subroutine valid(x)
13 logical :: x
14 if(x) call sndValid()
15 print *, 'OK'
16 end subroutine valid
18 subroutine sndValid()
19 call valid(.false.)
20 end subroutine sndValid
22 subroutine invalid(x)
23 logical :: x
24 if(x) call sndInvalid()
25 print *, 'BUG'
26 STOP 1
27 end subroutine invalid
29 subroutine sndInvalid()
30 call invalid(.false.)
31 end subroutine sndInvalid
33 call valid(.true.)
34 call valid(.true.)
35 call NormalFunc()
36 call NormalFunc()
37 call invalid(.true.)
38 end
40 ! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'invalid'" }