re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_assumed_charlen_2.f90
blobdf5d3aa9722a176769f8a5b0d341e28d775b3408
1 ! { dg-do compile }
2 ! PR fortran/82934
3 ! PR fortran/83318
4 program a
5 character(len=42), allocatable :: f
6 character(len=22), allocatable :: ff
7 call alloc(f, ff)
8 if (len(f) .ne. 42) STOP 1
9 if (len(ff) .ne. 22) STOP 2
10 contains
11 subroutine alloc( a, b )
12 character(len=*), allocatable :: a
13 character(len=22), allocatable :: b
14 character(len=:), allocatable :: c
15 character, allocatable :: d
16 allocate(character(len=*)::a,b) ! { dg-error "Incompatible allocate-object" }
17 allocate(character(len=*)::c) ! { dg-error "Incompatible allocate-object" }
18 allocate(character(len=*)::d) ! { dg-error "Incompatible allocate-object" }
19 end subroutine
20 end program a