RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / intent_out_5.f90
blob0df04f7f04a160995bff444502738c5516a93f64
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) STOP 1
17 if (allocated(container%a)) STOP 2
18 container%n = 1
19 allocate(container%a(50))
20 call init (container)
21 if (container%n /= 42) STOP 3
22 if (allocated(container%a)) STOP 4
23 contains
24 subroutine init (container)
25 type(container_t), intent(out) :: container
26 end subroutine init
27 end program main