aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pdt_27.f03
blob: 525b9999f3d293421012417c028ffddf0c4921ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
!
! Test the fix for PR83611, in which the assignment caused a
! double free error and the initialization of 'foo' was not done.
!
module pdt_m
  implicit none
  type :: vec(k)
     integer, len :: k=3
     integer :: foo(k)=[1,2,3]
  end type vec
end module pdt_m

program test_pdt
  use pdt_m
  implicit none
  type(vec) :: u,v
  if (any (u%foo .ne. [1,2,3])) STOP 1
  u%foo = [7,8,9]
  v = u
  if (any (v%foo .ne. [7,8,9])) STOP 2
end program test_pdt