PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / select_type_14.f03
blob3b170eacd4e4c6632b2aadb3df3ce6aaee86e51b
1 ! { dg-do run }
3 ! PR fortran/44047
4 ! Double free happened, check that it works now.
6 ! Contributed by Janus Weil, janus@gcc.gnu.org.
8 implicit none
9 type t0
10  integer :: j = 42
11 end type t0
12 type t
13  integer :: i
14  class(t0), allocatable :: foo
15 end type t
16 type(t) :: m
17 allocate(t0 :: m%foo)
18 m%i = 5
19 select type(bar => m%foo)
20 type is(t0)
21  print *, bar
22  if (bar%j /= 42) STOP 1
23 end select
24 end