2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / trim_optimize_8.f90
blob60dfd193a487360e1a6d75ff5addcd185df28870
1 ! { dg-do compile }
2 ! { dg-options "-O -fdump-tree-original" }
3 ! Check that trailing trims are also removed from assignment of
4 ! expressions involving concatenations of strings .
5 program main
6 character(2) :: a,b
7 character(8) :: d
8 a = 'a '
9 b = 'b '
10 if (trim(a // trim(b)) /= 'a b ') call abort
11 if (trim (trim(a) // trim(b)) /= 'ab ') call abort
12 end
13 ! { dg-final { scan-tree-dump-times "string_len_trim" 1 "original" } }
14 ! { dg-final { cleanup-tree-dump "original" } }