Debian Codegraph @

gcc/testsuite/gfortran.dg/allocate_assumed_charlen_2.f90

raw
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