summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_derived_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/allocate_derived_5.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_derived_5.f9020
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocate_derived_5.f90 b/gcc/testsuite/gfortran.dg/allocate_derived_5.f90
new file mode 100644
index 000000000..70d63aa1a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_derived_5.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+!
+! PR 45828: [4.6 Regression] No default initialization of derived type members?
+!
+! Contributed by Juha <jpr@csc.fi>
+
+program fail1
+ type a
+ integer :: i
+ end type a
+
+ type b
+ type(a) :: acomp = a(5)
+ end type b
+
+ type(b), allocatable :: c(:)
+
+ allocate(c(1))
+ if (c(1) % acomp % i /= 5) call abort()
+end program fail1