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