111
|
1 ! { dg-do compile }
|
|
2 ! Check a few constraints for ALLOCATABLE dummy arguments.
|
|
3 program alloc_dummy
|
|
4
|
|
5 implicit none
|
|
6 integer :: a(5)
|
|
7
|
|
8 call init(a) ! { dg-error "must be ALLOCATABLE" }
|
|
9
|
|
10 contains
|
|
11
|
|
12 subroutine init(x)
|
|
13 integer, allocatable, intent(out) :: x(:)
|
|
14 end subroutine init
|
|
15
|
|
16 subroutine init2(x)
|
|
17 integer, allocatable, intent(in) :: x(:)
|
|
18
|
|
19 allocate(x(3)) ! { dg-error "variable definition context" }
|
|
20 end subroutine init2
|
|
21
|
|
22 subroutine kill(x)
|
|
23 integer, allocatable, intent(in) :: x(:)
|
|
24
|
|
25 deallocate(x) ! { dg-error "variable definition context" }
|
|
26 end subroutine kill
|
|
27
|
|
28 end program alloc_dummy
|