Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/realloc_on_assign_25.f90 @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do run } ! PR 47674 - this would segfault if MALLOC_PERTURB is set. ! This checks a code path where it is not possible to determine ! the length of the string at compile time. ! program main implicit none character(:), allocatable :: a integer :: m, n a = 'a' if (a .ne. 'a') STOP 1 a = a // 'x' if (a .ne. 'ax') STOP 2 if (len (a) .ne. 2) STOP 3 n = 2 m = 2 a = a(m:n) if (a .ne. 'x') STOP 4 if (len (a) .ne. 1) STOP 5 end program main