OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [contained_3.f90] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Program to test contained functions calling their siblings.
2
! This is tricky because we don't find the declaration for the sibling
3
! function until after the caller has been parsed.
4
program contained_3
5
  call test
6
contains
7
  subroutine test
8
    if (sub(3) .ne. 6) call abort
9
  end subroutine
10
  integer function sub(i)
11
    integer i
12
    if (i .gt. 1) then
13
      sub = sub2(i) * i
14
    else
15
      sub = 1
16
    end if
17
  end function
18
  integer function sub2(i)
19
    integer i
20
    sub2 = sub(i - 1)
21
  end function
22
end program

powered by: WebSVN 2.1.0

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