OSDN Git Service

2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / allocatable_dummy_2.f90
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 "Cannot allocate" }
20     end subroutine init2
21
22     subroutine kill(x)
23         integer, allocatable, intent(in) :: x(:)
24         
25         deallocate(x) ! { dg-error "Cannot deallocate" }
26     end subroutine kill
27
28 end program alloc_dummy