arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR115360]
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_with_mold_3.f90
blob797edbe7d49e5bf569483e6ba78d58423b8fa665
1 ! { dg-do run }
2 ! PR fortran/89174 - this used to segfault on execution.
3 ! Test case by Neil Carlson.
4 module mod
5 type :: array_data
6 class(*), allocatable :: mold
7 contains
8 procedure :: push
9 end type
10 contains
11 subroutine push(this, value)
12 class(array_data), intent(inout) :: this
13 class(*), intent(in) :: value
14 allocate(this%mold, mold=value) ! <== SEGFAULTS HERE
15 end subroutine
16 end module
18 use mod
19 type(array_data) :: foo
20 call foo%push(42)
21 end