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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [used_types_11.f90] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! Tests the patch for PR 29641, in which an ICE would occur with
3
! the ordering of USE statements below.
4
!
5
! Contributed by Jakub Jelinek 
6
!
7
module A
8
  type :: T
9
    integer :: u
10
  end type T
11
end module A
12
 
13
module B
14
contains
15
  function foo()
16
    use A
17
    type(T), pointer :: foo
18
    nullify (foo)
19
  end function foo
20
end module B
21
 
22
subroutine bar()
23
  use B             ! The order here is important
24
  use A             ! If use A comes before use B, it works
25
  type(T), pointer :: x
26
  x => foo()
27
end subroutine bar
28
 
29
  use B
30
  use A
31
  type(T), pointer :: x
32
  type(T), target  :: y
33
  x => y
34
  print *, associated (x)
35
  x => foo ()
36
  print *, associated (x)
37
end
38
! { 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.