aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/trim_optimize_3.f90
blob: 33cf8b2b9408f2ff95598d36732e99c3b0438b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do run }
! { dg-options "-O -fdump-tree-original" }
! PR 47065 - replace trim with substring expressions.
program main
  character(len=10) :: a, b
  character(kind=4,len=10) :: a4, b4
  character(len=100) :: line
  a = 'bcd'
  b = trim(a) // 'x'
  if (b /= 'bcdx') call abort
  a4 = 4_"bcd"
  b4 = trim(a4) // 4_'x'
  if (b4 /= 4_'bcdx') call abort
end
! { dg-final { scan-tree-dump-times "string_len_trim" 2 "original" } }
! { dg-final { cleanup-tree-dump "original" } }