2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / trim_optimize_1.f90
blob26aa5cd94e043e385e63bd2f5c78d01abee894be
1 ! { dg-do run }
2 ! { dg-options "-O -fdump-tree-original" }
3 ! PR 40628 - optimize unnecessary TRIMs on assignment
4 program main
5 character(len=3) :: a
6 character(len=4) :: b,c
7 b = 'abcd'
8 a = trim(b)
9 c = trim(trim(a))
10 if (a /= 'abc') call abort
11 if (c /= 'abc') call abort
12 end program main
14 ! { dg-final { scan-tree-dump-times "memmove" 2 "original" } }
15 ! { dg-final { scan-tree-dump-times "string_trim" 0 "original" } }
16 ! { dg-final { cleanup-tree-dump "original" } }