Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray/alloc_comp_9.f90

raw
1 !{ dg-do run }
2
3 ! Check PR85002 is fixed.
4 ! Contributed by G. Steinmetz <[email protected]>
5
6 program pr85002
7 type t
8 integer, allocatable :: a(:)
9 end type
10 type t2
11 type(t), allocatable :: b(:)
12 end type
13 type(t) :: x
14 type(t2) :: y(2)[*]
15
16 allocate (x%a(2))
17 x%a = 123
18 y = t2([x])
19
20 if (.not. all((/(allocated(y(i)%b), i=1, 2)/))) stop 1
21 if (any ((/(y(i)%b(1)%a /= 123, i=1,2)/))) stop 2
22 end
23