1! { dg-do compile }
2! { dg-options "-fdump-tree-original" }
3!
4! Ensure that for zero-sized array, nonzero memory is allocated
5!
6type t
7end type t
8
9type(t), allocatable :: x, y(:)
10
11x = t()
12y = [ t :: ]
13
14if (.not. allocated (x)) call abort ()
15if (.not. allocated (y)) call abort ()
16end
17
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" } }
21