PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / derived_init_3.f90
bloba1c4a0c7e0db0b629de3f5aa250707410236bc7f
1 ! { dg-do run }
3 ! PR fortran/40851
5 ! Make sure the an INTENT(OUT) dummy is not initialized
6 ! when it is a pointer.
8 ! Contributed by Juergen Reuter <juergen.reuter@desy.de>.
10 program main
12 type :: string
13 character,dimension(:),allocatable :: chars
14 end type string
16 type :: string_container
17 type(string) :: string
18 end type string_container
20 type(string_container), target :: tgt
21 type(string_container), pointer :: ptr
23 ptr => tgt
24 call set_ptr (ptr)
25 if (associated(ptr)) call abort()
27 contains
29 subroutine set_ptr (ptr)
30 type(string_container), pointer, intent(out) :: ptr
31 ptr => null ()
32 end subroutine set_ptr
34 end program main