* tree-loop-distribution.c (struct partition): New field recording
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_deep_copy_3.f03
blob7032eaf8f3af6f9140f4864d1890d0896d0f96d2
1 ! { dg-do run }
3 ! PR fortran/67721
4 ! Check that scalar to array assignments of derived type constructor
5 ! deep copy the value when there are allocatable components.
7 program p
8   implicit none
10   type :: t1
11     integer :: c1
12   end type t1
13   type :: t2
14     type(t1), allocatable :: c2
15   end type t2
17   block
18     type(t2) :: v(4)
20     v = t2(t1(3))
21     v(2)%c2%c1 =  7
22     v(3)%c2%c1 = 11
23     v(4)%c2%c1 = 13
25     if (v(1)%c2%c1 /=  3) call abort
26     if (v(2)%c2%c1 /=  7) call abort
27     if (v(3)%c2%c1 /= 11) call abort
28     if (v(4)%c2%c1 /= 13) call abort
29   end block
30 end program p