From: Thomas Koenig Date: Thu, 22 Feb 2018 22:01:53 +0000 (+0000) Subject: re PR fortran/59781 ([F03] Incorrect initialisation of derived type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8304bcf24a2d301044a881438221841cf09444d7;p=gcc.git re PR fortran/59781 ([F03] Incorrect initialisation of derived type) 2018-02-22 Thomas Koenig PR fortran/59781 * gfortran.dg/derived_init_5.f90: New test. From-SVN: r257917 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 368b9809371..62b65bf8e1c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-22 Thomas Koenig + + PR fortran/59781 + * gfortran.dg/derived_init_5.f90: New test. + 2018-02-22 Jakub Jelinek PR target/82851 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