libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / trim_optimize_5.f90
blob40445e5147d8b11a75c98f09e964a2a079d2a97e
1 ! { dg-do run }
2 ! { dg-options "-O -fdump-tree-original" }
3 ! PR 47065 - replace trim with substring expressions even with references.
4 program main
5 implicit none
6 type t
7 character(len=2) :: x
8 end type t
9 type(t) :: a
10 character(len=3) :: b
11 character(len=10) :: line
12 a%x = 'a'
13 write(unit=line,fmt='(A,A)') trim(a%x),"X"
14 if (line /= 'aX ') call abort
15 b = 'ab'
16 write (unit=line,fmt='(A,A)') trim(b),"Y"
17 if (line /= 'abY ') call abort
18 end program main
19 ! { dg-final { scan-tree-dump-times "string_len_trim" 2 "original" } }
20 ! { dg-final { cleanup-tree-dump "original" } }