aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/derived_init_5.f90
blob: b94ca39ce026d70bde7a57ccc5d09b2aaab08a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { dg-do  run }
! PR 59781 - this was not initialized correctly before.
! Original test case by James Spencer.
  implicit none
  
  type t1
    integer :: s
  end type
  
  type t2
    type(t1) :: state = t1(1)
    real, allocatable :: store(:)
  end type
  
  call test

contains

  subroutine test
    type(t2) :: rng
    if (rng%state%s /= 1) STOP 1
  end subroutine

end