* gfortran.fortran-torture/execute/contained_3.f90: New test.
From-SVN: r83033
This commit is contained in:
parent
f814193b9d
commit
b08eae9288
2 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2004-06-12 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
* gfortran.fortran-torture/execute/contained_3.f90: New test.
|
||||
|
||||
2004-06-12 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
|
||||
|
||||
PR fortran/14923
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
! Program to test contained functions calling their siblings.
|
||||
! This is tricky because we don't find the declaration for the sibling
|
||||
! function until after the caller has been parsed.
|
||||
program contained_3
|
||||
call test
|
||||
contains
|
||||
subroutine test
|
||||
if (sub(3) .ne. 6) call abort
|
||||
end subroutine
|
||||
integer function sub(i)
|
||||
integer i
|
||||
if (i .gt. 1) then
|
||||
sub = sub2(i) * i
|
||||
else
|
||||
sub = 1
|
||||
end if
|
||||
end function
|
||||
integer function sub2(i)
|
||||
integer i
|
||||
sub2 = sub(i - 1)
|
||||
end function
|
||||
end program
|
Loading…
Add table
Reference in a new issue