view gcc/testsuite/gfortran.dg/pdt_27.f03 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { 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