diff options
author | Paul Brook <paul@codesourcery.com> | 2004-06-12 15:37:23 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-06-12 15:37:23 +0000 |
commit | b08eae928826bd8474cd30a33949af242dfc400c (patch) | |
tree | 4e2f313f36a543b21db988a2ab3979715e15c262 /gcc | |
parent | f814193b9d8f34c0c344f734d66aae2a032dddc8 (diff) | |
download | gcc-b08eae928826bd8474cd30a33949af242dfc400c.zip gcc-b08eae928826bd8474cd30a33949af242dfc400c.tar.gz gcc-b08eae928826bd8474cd30a33949af242dfc400c.tar.bz2 |
* gfortran.fortran-torture/execute/contained_3.f90: New test.
From-SVN: r83033
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/contained_3.f90 | 22 |
2 files changed, 26 insertions, 0 deletions
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 <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 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 |