OSDN Git Service

2010-04-27 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / alloc_comp_assign_9.f90
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 !
8 PROGRAM 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) CALL ABORT
20 END PROGRAM X