view gcc/testsuite/gfortran.dg/trim_optimize_8.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-O -fdump-tree-original" }
! Check that trailing trims are also removed from assignment of
! expressions involving concatenations of strings .
program main
  character(2) :: a,b
  character(8) :: d
  a = 'a '
  b = 'b '
  if (trim(a // trim(b)) /= 'a b ') STOP 1
  if (trim (trim(a) // trim(b)) /= 'ab ') STOP 2
end
! { dg-final { scan-tree-dump-times "string_len_trim" 1 "original" } }