Fix warnings occured during profiledboostrap on
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_25.f90
blob1e2a27389769ae6da03e4465ab8359e73eff6589
1 ! { dg-do run }
2 ! PR 47674 - this would segfault if MALLOC_PERTURB is set.
3 ! This checks a code path where it is not possible to determine
4 ! the length of the string at compile time.
6 program main
7 implicit none
8 character(:), allocatable :: a
9 integer :: m, n
10 a = 'a'
11 if (a .ne. 'a') call abort
12 a = a // 'x'
13 if (a .ne. 'ax') call abort
14 if (len (a) .ne. 2) call abort
15 n = 2
16 m = 2
17 a = a(m:n)
18 if (a .ne. 'x') call abort
19 if (len (a) .ne. 1) call abort
20 end program main