2010-11-30 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_constructor_3.f90
blob53fa79c00f04adea17b2ae8a46485ba3ab1665ac
1 ! { dg-do run }
2 ! Tests the fix for PR32665 in which the structure initializer at line
3 ! 13 was getting the array length wrong by one and in which the automatic
4 ! deallocation of a in 14 was occurring before the evaluation of the rhs.
6 ! Contributed by Daniel Franke <dfranke@gcc.gnu.org>
8 TYPE :: x
9 INTEGER, ALLOCATABLE :: a(:)
10 END TYPE
11 TYPE(x) :: a
13 a = x ((/ 1, 2, 3 /)) ! This is also pr31320.
14 a = x ((/ a%a, 4 /))
15 if (any (a%a .ne. (/1,2,3,4/))) call abort ()
16 end