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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [contained_3.f90] - Blame information for rev 801

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

Line No. Rev Author Line
1 695 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.