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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [external_procedures_2.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
! Tests the for PR30410, in which the reference to extfunc would
3
! be incorrectly made to the module namespace.
4
!
5
! Contributed by Harald Anlauf 
6
!
7
module mod1
8
contains
9
  function eval (func, x1)
10
    real     :: eval, func, x1
11
    external :: func
12
    eval = func (x1)
13
  end function eval
14
end module mod1
15
!-------------------------------
16
module mod2
17
  use mod1, only : eval
18
  real, external :: extfunc     ! This was referenced as __mod2__extfunc__
19
contains
20
 
21
  subroutine foo (x0)
22
    real :: x0, x1
23
    x1 = 42
24
    x0 = eval (extfunc, x1)
25
  end subroutine foo
26
 
27
end module mod2
28
!-------------------------------
29
function extfunc (x)
30
  real, intent(in) ::  x
31
  real             ::  extfunc
32
  extfunc = x
33
end function extfunc
34
!-------------------------------
35
program gfcbug53
36
  use mod2, only : foo
37
  real :: x0 = 0
38
  call foo (x0)
39
  print *, x0
40
end program gfcbug53
41
! { dg-final { cleanup-modules "mod1 mod2" } }

powered by: WebSVN 2.1.0

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