From b08eae928826bd8474cd30a33949af242dfc400c Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Sat, 12 Jun 2004 15:37:23 +0000 Subject: [PATCH] * gfortran.fortran-torture/execute/contained_3.f90: New test. From-SVN: r83033 --- gcc/testsuite/ChangeLog | 4 ++++ .../execute/contained_3.f90 | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/contained_3.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e9b731..9862dead 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-06-12 Paul Brook + + * gfortran.fortran-torture/execute/contained_3.f90: New test. + 2004-06-12 Tobias Schlueter PR fortran/14923 diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/contained_3.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/contained_3.f90 new file mode 100644 index 0000000..d0de1f4 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/contained_3.f90 @@ -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 -- 2.7.4