summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pdt_19.f03
blob: cdcd00c63c68c8a0dca7b3123d5ef67c64d5d053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! { dg-do compile }
!
! Tests the fix for PR82606.
!
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
!
program p
   type t(a, b)
      integer, len :: b   ! Note different order of component declarations
      integer, kind :: a  ! compared with the type_spec_list order.
      real(a) :: r(b)
   end type
   type(t(8, :)), allocatable :: x
   real(x%a) :: y         ! Used to die here because initializers were mixed up.
   allocate(t(8, 2) :: x)
   if (kind(y) .ne. x%a) STOP 1
   deallocate(x)
end