fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocatable_dummy_2.f90
blob1f0864ba37154366121b1acea6d9da123f22b0de
1 ! { dg-do compile }
2 ! Check a few constraints for ALLOCATABLE dummy arguments.
3 program alloc_dummy
5 implicit none
6 integer :: a(5)
8 call init(a) ! { dg-error "must be ALLOCATABLE" }
10 contains
12 subroutine init(x)
13 integer, allocatable, intent(out) :: x(:)
14 end subroutine init
16 subroutine init2(x)
17 integer, allocatable, intent(in) :: x(:)
19 allocate(x(3)) ! { dg-error "variable definition context" }
20 end subroutine init2
22 subroutine kill(x)
23 integer, allocatable, intent(in) :: x(:)
25 deallocate(x) ! { dg-error "variable definition context" }
26 end subroutine kill
28 end program alloc_dummy