OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [contained_3.f90] - Rev 378

Go to most recent revision | Compare with Previous | Blame | View Log

! 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

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.