PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / whole_file_14.f90
blob030e8cd14592a33ea1923d3898f26af47d17309e
1 ! { dg-do run }
2 ! { dg-options "-fwhole-file -O3" }
3 ! Check that the derived types are correctly substituted when
4 ! whole file compiling.
6 ! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr
8 module global
9 type :: mytype
10 type(mytype),pointer :: this
11 end type mytype
12 type(mytype),target :: base
13 end module global
15 program test_equi
16 use global
17 call check()
18 print *, "base%this%this=>base?" , associated(base%this%this,base)
19 print *, "base%this%this=>?" , associated(base%this%this)
20 print *, "base%this=>?" , associated(base%this)
21 contains
22 subroutine check()
23 type(mytype),target :: j
24 base%this => j !have the variables point
25 j%this => base !to one another
26 end subroutine check !take j out of scope
27 end program test_equi