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/] [entry_1.f90] - Diff between revs 302 and 384

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
! Test alternate entry points in a module procedure
! Test alternate entry points in a module procedure
! Also check that references to sibling entry points are resolved correctly.
! Also check that references to sibling entry points are resolved correctly.
module m
module m
contains
contains
subroutine indirecta (p)
subroutine indirecta (p)
  call p (3, 4)
  call p (3, 4)
end subroutine
end subroutine
subroutine indirectb (p)
subroutine indirectb (p)
  call p (5)
  call p (5)
end subroutine
end subroutine
subroutine test1
subroutine test1
  implicit none
  implicit none
  call indirecta (foo)
  call indirecta (foo)
  call indirectb (bar)
  call indirectb (bar)
end subroutine
end subroutine
subroutine foo(a, b)
subroutine foo(a, b)
  integer a, b
  integer a, b
  logical, save :: was_foo = .false.
  logical, save :: was_foo = .false.
  if ((a .ne. 3) .or. (b .ne. 4)) call abort
  if ((a .ne. 3) .or. (b .ne. 4)) call abort
  was_foo = .true.
  was_foo = .true.
entry bar(a)
entry bar(a)
  if (was_foo) then
  if (was_foo) then
    if ((a .ne. 3) .or. (b .ne. 4)) call abort
    if ((a .ne. 3) .or. (b .ne. 4)) call abort
  else
  else
    if (a .ne. 5) call abort
    if (a .ne. 5) call abort
  end if
  end if
  was_foo = .false.
  was_foo = .false.
end subroutine
end subroutine
subroutine test2
subroutine test2
  call foo (3, 4)
  call foo (3, 4)
  call bar (5)
  call bar (5)
end subroutine
end subroutine
end module
end module
program p
program p
  use m
  use m
  call foo (3, 4)
  call foo (3, 4)
  call bar (5)
  call bar (5)
  call test1 ()
  call test1 ()
  call test2 ()
  call test2 ()
end program
end program
! { dg-final { cleanup-modules "m" } }
! { dg-final { cleanup-modules "m" } }
 
 

powered by: WebSVN 2.1.0

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