2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_memcpy_2.f90
blobbe8f00d1738dd0b80b7157e03a18d44c65d43393
1 ! This checks that the "z = y" assignment is not considered copyable, as the
2 ! array is of a derived type containing allocatable components. Hence, we
3 ! we should expand the scalarized loop, which contains *two* memcpy calls.
4 ! { dg-do compile }
5 ! { dg-options "-O2 -fdump-tree-original" }
7 type :: a
8 integer, allocatable :: i(:)
9 end type a
11 type :: b
12 type (a), allocatable :: at(:)
13 end type b
15 type(b) :: y(2), z(2)
17 z = y
18 end
19 ! { dg-final { scan-tree-dump-times "memcpy" 2 "original" } }
20 ! { dg-final { cleanup-tree-dump "original" } }