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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR 47065 - make sure that trim optimization does not lead to
3
! wrong-code with aliasing.
4
! Test case provided by Tobias Burnus.
5
program main
6
  character(len=12) :: str
7
  str = '1234567890'
8
  call sub(trim(str), str)
9
  ! Should print '12345       '
10
  if (str /= '12345       ') call abort
11
  call two(trim(str))
12
  if (str /= '123         ') call abort
13
contains
14
  subroutine sub(a,b)
15
    character(len=*), intent(in) :: a
16
    character(len=*), intent(out) :: b
17
    b = ''
18
    b = a(1:5)
19
  end subroutine sub
20
  subroutine two(a)
21
    character(len=*), intent(in) :: a
22
    str = ''
23
    str(1:3) = a(1:3)
24
  end subroutine two
25
end program main

powered by: WebSVN 2.1.0

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