2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_19.f03
blob3a12e0e3556502cd3b11cc2d78ce512cbe8610df
1 ! { dg-do compile }
3 ! Tests the fix for PR82606.
5 ! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
7 program p
8    type t(a, b)
9       integer, len :: b   ! Note different order of component declarations
10       integer, kind :: a  ! compared with the type_spec_list order.
11       real(a) :: r(b)
12    end type
13    type(t(8, :)), allocatable :: x
14    real(x%a) :: y         ! Used to die here because initializers were mixed up.
15    allocate(t(8, 2) :: x)
16    if (kind(y) .ne. x%a) call abort
17    deallocate(x)
18 end