summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_alloc_opt_2.f90
blob: a52b71e4984ba7b2e8be652e17243af983eda74b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
! { dg-do compile }
subroutine sub(i, j, err)
   implicit none
   character(len=*), intent(in) :: err
   integer, intent(in) :: j
   integer, intent(in), allocatable :: i(:)
   integer, allocatable :: m(:)
   integer n
   allocate(i(2)) ! { dg-error "variable definition context" }
   allocate(m(2), stat=j) ! { dg-error "variable definition context" }
   allocate(m(2),stat=n,errmsg=err) ! { dg-error "variable definition context" }
end subroutine sub