OSDN Git Service

* config/i386/i386.md (UNSPEC_VSIBADDR): New.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / trim_optimize_6.f90
1 ! { dg-do run }
2 ! PR 47065 - make sure that impure functions are not evaluated twice when
3 ! replacing calls to trim with expression(1:len_trim)
4 module foo
5   implicit none
6 contains
7   function f()
8     integer :: f
9     integer :: s=0
10     s = s + 1
11     f = s
12   end function f
13 end module foo
14
15 program main
16   use foo
17   implicit none
18   character(len=10) :: line
19   character(len=4) :: b(2)
20   b(1) = 'a'
21   b(2) = 'bc'
22   write(unit=line,fmt='(A,A)') trim(b(f())), "X"
23   if (line /= "aX          ") call abort
24   if (f() .ne. 2) call abort
25 end program main
26
27 ! { dg-final { cleanup-modules "foo" } }