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

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

Rev 302 Rev 384
! { dg-do compile }
! { dg-do compile }
! Tests the patch for PR 29641, in which an ICE would occur with
! Tests the patch for PR 29641, in which an ICE would occur with
! the ordering of USE statements below.
! the ordering of USE statements below.
!
!
! Contributed by Jakub Jelinek 
! Contributed by Jakub Jelinek 
!
!
module A
module A
  type :: T
  type :: T
    integer :: u
    integer :: u
  end type T
  end type T
end module A
end module A
module B
module B
contains
contains
  function foo()
  function foo()
    use A
    use A
    type(T), pointer :: foo
    type(T), pointer :: foo
    nullify (foo)
    nullify (foo)
  end function foo
  end function foo
end module B
end module B
subroutine bar()
subroutine bar()
  use B             ! The order here is important
  use B             ! The order here is important
  use A             ! If use A comes before use B, it works
  use A             ! If use A comes before use B, it works
  type(T), pointer :: x
  type(T), pointer :: x
  x => foo()
  x => foo()
end subroutine bar
end subroutine bar
  use B
  use B
  use A
  use A
  type(T), pointer :: x
  type(T), pointer :: x
  type(T), target  :: y
  type(T), target  :: y
  x => y
  x => y
  print *, associated (x)
  print *, associated (x)
  x => foo ()
  x => foo ()
  print *, associated (x)
  print *, associated (x)
end
end
! { dg-final { cleanup-modules "A B" } }
! { dg-final { cleanup-modules "A B" } }
 
 

powered by: WebSVN 2.1.0

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