summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pdt_20.f03
blob: b712ed59dbb07b2089e9bda75fd9a174fdf41d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
!
! Tests the fix for PR82622.
!
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
!
program p
   type t(a)
      integer, len :: a
   end type
   type t2(b)
      integer, len :: b
      type(t(1)) :: r(b)
   end type
   type(t2(:)), allocatable :: x
   allocate (t2(3) :: x)            ! Used to segfault in trans-array.c.
   if (x%b .ne. 3) STOP 1
   if (x%b .ne. size (x%r, 1)) STOP 2
   if (any (x%r%a .ne. 1)) STOP 3
end