2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_9.f90
blob69f1ecc02159a8fcdbf0b4c6a5c7650396f26242
1 ! { dg-do run }
3 ! PR fortran/51869
5 module soop_stars_class
6 implicit none
7 type soop_stars
8 real ,dimension(:,:) ,allocatable :: position
9 end type
10 type show
11 type(soop_stars) :: rocket
12 end type
13 contains
14 function new_show(boom)
15 type(soop_stars) ,intent(in) :: boom
16 type(show) :: new_show
17 new_show%rocket = boom
18 end function
19 end module
21 program main
22 use soop_stars_class
23 implicit none
25 type(soop_stars) :: fireworks
26 type(show), allocatable :: july4
28 allocate (fireworks%position(2,2))
29 fireworks%position = 33.0
31 july4 = new_show(boom=fireworks)
32 end program