OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [trim_optimize_6.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { 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" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.