RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_constructor_3.f90
blob73aef7833146ad39466fdf362603478c264514b3
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/))) STOP 1
16 end