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.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [whole_file_10.f90] - Blame information for rev 437

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! { dg-options "-fwhole-file" }
3
! Test the fix for the fifth problem in PR40011, where the
4
! entries were not resolved, resulting in a segfault.
5
!
6
! Contributed by Dominique d'Humieres 
7
!
8
recursive function fac(i) result (res)
9
  integer :: i, j, k, res
10
  k = 1
11
  goto 100
12
entry bifac(i,j) result (res)
13
  k = j
14
100 continue
15
  if (i < k) then
16
    res = 1
17
  else
18
    res = i * bifac(i-k,k)
19
  end if
20
end function
21
 
22
program test
23
  external fac
24
  external bifac
25
  integer :: fac, bifac
26
  print *, fac(5)
27
  print *, bifac(5,2)
28
  print*, fac(6)
29
  print *, bifac(6,2)
30
  print*, fac(0)
31
  print *, bifac(1,2)
32
end program test

powered by: WebSVN 2.1.0

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