Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gfortran.dg / allocate_error_4.f90
1 ! { dg-do compile }
2 ! PR fortran/55314 - the second allocate statement was rejected.
3
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