RISC-V: Regenerate opt urls.
[official-gcc.git] / gcc / testsuite / gfortran.dg / used_types_11.f90
blobb3f4eaa56e4a4a4bc2bc758c82a0fab104730ac5
1 ! { dg-do compile }
2 ! Tests the patch for PR 29641, in which an ICE would occur with
3 ! the ordering of USE statements below.
5 ! Contributed by Jakub Jelinek <jakub@gcc.gnu.org>
7 module A
8 type :: T
9 integer :: u
10 end type T
11 end module A
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
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
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