2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / intent_out_5.f90
blob6a9c6f4bd39a17f61b1f92b9b9061bb88ac478c3
1 ! { dg-do run }
3 ! PR fortran/41479
5 ! Contributed by Juergen Reuter.
7 program main
8 type :: container_t
9 integer :: n = 42
10 ! if the following line is omitted, the problem disappears
11 integer, dimension(:), allocatable :: a
12 end type container_t
14 type(container_t) :: container
16 if (container%n /= 42) call abort()
17 if (allocated(container%a)) call abort()
18 container%n = 1
19 allocate(container%a(50))
20 call init (container)
21 if (container%n /= 42) call abort()
22 if (allocated(container%a)) call abort()
23 contains
24 subroutine init (container)
25 type(container_t), intent(out) :: container
26 end subroutine init
27 end program main