2017-12-15 Markus Trippelsdorf <markus@trippelsdorf.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_22.f03
blob3516ae2420a102b002aa709be9e98cb722e98195
1 ! { dg-do run }
3 ! Tests the fix for PR82622 comment #1, where the declaration of
4 ! 'x' choked during initialization. Once fixed, it was found that
5 ! IO was not working correctly for PDT array components.
7 ! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
9 program p
10    character(120) :: buffer
11    integer :: i(4)
12    type t(a)
13       integer, len :: a
14    end type
15    type t2(b)
16       integer, len :: b
17       type(t(1)) :: r(b)
18    end type
19    type(t2(3)) :: x
20    write (buffer,*) x
21    read (buffer,*) i
22    if (any (i .ne. [3,1,1,1])) call abort
23 end