libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_18.f90
blobd1743551e368c3914b360135656b53dedf51b6f5
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! Ensure that for zero-sized array, nonzero memory is allocated
6 type t
7 end type t
9 type(t), allocatable :: x, y(:)
11 x = t()
12 y = [ t :: ]
14 if (.not. allocated (x)) call abort ()
15 if (.not. allocated (y)) call abort ()
16 end
18 ! { dg-final { scan-tree-dump "x = \\(struct t .\\) __builtin_malloc \\(1\\);" "original" } }
19 ! { dg-final { scan-tree-dump "y.data = \\(void . restrict\\) __builtin_malloc \\(1\\);" "original" } }
20 ! { dg-final { cleanup-tree-dump "original" } }