diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/derived_init_5.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/derived_init_5.f90 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/derived_init_5.f90 b/gcc/testsuite/gfortran.dg/derived_init_5.f90 new file mode 100644 index 00000000000..b94ca39ce02 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_init_5.f90 @@ -0,0 +1,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 |