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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [whole_file_10.f90] - Blame information for rev 801

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

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