PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_constructor_4.f90
blob680085b65060f53bd3b878c6c32fc54377766eb2
1 ! { dg-do run }
2 ! Tests the fix for PR32795, which was primarily about memory leakage is
3 ! certain combinations of alloctable components and constructors. This test
4 ! which appears in comment #2 of the PR has the advantage of a wrong
5 ! numeric result which is symptomatic.
7 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
9 type :: a
10 integer, allocatable :: i(:)
11 end type a
12 type(a) :: x, y
13 x = a ([1, 2, 3])
14 y = a (x%i(:)) ! used to cause a memory leak and wrong result
15 if (any (x%i .ne. [1, 2, 3])) STOP 1
16 end