PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_error_4.f90
blob6652b472f49c44880c48f83aec01fb4158a03e43
1 ! { dg-do compile }
2 ! PR fortran/55314 - the second allocate statement was rejected.
4 program main
5 implicit none
6 integer :: max_nb
7 type comm_mask
8 integer(4), pointer :: mask(:)
9 end type comm_mask
10 type (comm_mask), allocatable, save :: encode(:,:)
11 max_nb=2
12 allocate( encode(1:1,1:max_nb))
13 allocate( encode(1,1)%mask(1),encode(1,2)%mask(1))
14 deallocate( encode(1,1)%mask,encode(1,2)%mask)
15 allocate( encode(1,1)%mask(1),encode(1,1)%mask(1)) ! { dg-error "also appears at" }
16 end program main