1! { dg-do run }
2
3! PR fortran/45384
4! Double free happened, check that it works now.
5
6! Contributed by Salvatore Filippone  <salvatore.filippone@uniroma2.it>
7
8program bug20
9
10  type :: d_base_sparse_mat
11    integer :: v(10) = 0.
12  end type d_base_sparse_mat
13
14  class(d_base_sparse_mat),allocatable :: a
15
16  allocate (d_base_sparse_mat :: a)
17
18  select type(aa => a)
19  type is (d_base_sparse_mat)
20    write(0,*) 'NV = ',size(aa%v)
21    if (size(aa%v) /= 10) call abort ()
22  class default 
23    write(0,*) 'Not implemented yet '
24  end select
25
26end program bug20
27