1! { dg-do run }
2! Test the fix for PR39519, where the presence of the pointer
3! as the first component was preventing the second from passing
4! the "alloc_comp" attribute to the derived type.
5!
6! Contributed by Gilbert Scott <gilbert.scott@easynet.co.uk>
7!
8PROGRAM X
9  TYPE T
10    INTEGER, POINTER :: P
11    INTEGER, ALLOCATABLE :: A(:)
12  END TYPE T
13  TYPE(T) :: T1,T2
14  ALLOCATE ( T1%A(1) )
15  ALLOCATE ( T2%A(1) )
16  T1%A = 23
17  T2 = T1
18  T1%A = 42
19  if (T2%A(1) .NE. 23) STOP 1
20END PROGRAM X
21