Debian Codegraph @

gcc/testsuite/gfortran.dg/loc_3.f90

raw
1 ! { dg-do compile }
2 ! { dg-additional-options "-O1" }
3 !
4 ! PR fortran/125606
5 !
6 ! Derived from Fujitsu testsuite
7 ! Reported by David Binderman
8
9 module m
10 implicit none
11 type ty
12 class(*), allocatable :: c1(:)
13 end type ty
14 type tt
15 class(*), allocatable :: node1(:)
16 end type tt
17 type,extends(tt)::tte
18 class(*), allocatable :: c2e(:)
19 end type tte
20 contains
21 subroutine put_addr
22 class(*), allocatable :: t(:)
23 integer :: unit
24 select type (t)
25 class is (tt)
26 select type (p=>t(2)%node1)
27 class is (ty)
28 write (unit) loc(p(2)%c1)
29 end select
30 select type (t)
31 type is (tte)
32 write (7) loc(t(2)%c2e)
33 end select
34 end select
35 end subroutine put_addr
36 end module m