PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_assign_15.f03
blob23448dde13d35a5c42df4cccacaece8983901501
1 ! { dg-do run }
3 ! Check the test for PR69422, in which the allocatable component 'Source'
4 ! of the pointer component 'P' was not automatically (re)allocated on
5 ! assignment.
7 ! Contributed by Anthony Lewis  <antony@cosmologist.info>
9 module funcs
10   implicit none
12   Type T
13     character(LEN=:), allocatable :: source
14   end type T
16   type TPointer
17     Type(T), pointer :: P
18   end type TPointer
20 end module
22 program Test1
23   use funcs
24   Type(TPointer) :: X
26   allocate(X%P)
28   X%P%Source = 'test string'
29   if (.not.allocated (X%P%Source)) STOP 1
30   if (X%P%Source .ne. 'test string') STOP 2
32 end program Test1