aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/structure_constructor_17.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/structure_constructor_17.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/structure_constructor_17.f9021
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/structure_constructor_17.f90 b/gcc/testsuite/gfortran.dg/structure_constructor_17.f90
new file mode 100644
index 00000000000..8b8230c6f7e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/structure_constructor_17.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+!
+! Test the fix for PR97612.
+!
+! Contributed by Martin Stein <mscfd@gmx.net>
+!
+program constructor_allocatable
+ implicit none
+
+ type :: s
+ integer, dimension(:), allocatable :: u
+ end type s
+
+ type :: t
+ type(s), dimension(:), allocatable :: x
+ end type t
+
+ type(t) :: a = t()
+ if (allocated (a%x)) stop 1
+
+end program constructor_allocatable