view gcc/testsuite/gfortran.dg/deferred_character_assignment_1.f90 @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
!
! Checks the fix for PR67977 in which automatic reallocation on assignment
! was performed when the lhs had a substring reference.
!
! Contributed by Anton Shterenlikht  <mexas@bristol.ac.uk>
!
  character(:), allocatable :: z
  integer :: length
  z = "cockatoo"
  length = len (z)
  z(:) = ''
  if (len(z) .ne. length) STOP 1
  if (trim (z) .ne. '') STOP 2
  z(:3) = "foo"
  if (len(z) .ne. length) STOP 3
  if (trim (z) .ne. "foo") STOP 4
  z(4:) = "__bar"
  if (len(z) .ne. length) STOP 5
  if (trim (z) .ne. "foo__bar") STOP 6
  deallocate (z)
end