Debian Codegraph @

gcc/testsuite/gfortran.dg/allocatable_scalar_14.f90

raw
1 ! { dg-do run }
2 !
3 ! Test the fix for PR64120 in which the initialisation of the
4 ! string length of 's' was not being done.
5 !
6 ! Contributed by Francois-Xavier Coudert <[email protected]>
7 !
8 call g(1)
9 call g(2)
10 contains
11 subroutine g(x)
12 integer :: x
13 character(len=x), allocatable :: s
14 allocate(s)
15 if (len(s) .ne. x) stop x
16 end subroutine
17 end