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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-O -fdump-tree-original" }
3
! Optimize unnecessary TRIMs in contained namespaces too.
4
module faz
5
  implicit none
6
contains
7
  subroutine bar
8
    character(len=3) :: a
9
    character(len=4) :: b,c
10
    b = 'abcd'
11
    a = trim(b)
12
    c = trim(trim(a))
13
    if (a /= 'abc') call abort
14
    if (c /= 'abc') call abort
15
  end subroutine bar
16
end module faz
17
 
18
program main
19
  use faz
20
  implicit none
21
  call foo
22
  call bar
23
contains
24
  subroutine foo
25
    character(len=3) :: a
26
    character(len=4) :: b,c
27
    b = 'abcd'
28
    a = trim(b)
29
    c = trim(trim(a))
30
    if (a /= 'abc') call abort
31
    if (c /= 'abc') call abort
32
  end subroutine foo
33
end program main
34
 
35
! { dg-final { scan-tree-dump-times "memmove" 4 "original" } }
36
! { dg-final { scan-tree-dump-times "string_trim" 0 "original" } }
37
! { dg-final { cleanup-tree-dump "original" } }
38
! { dg-final { cleanup-modules "faz" } }

powered by: WebSVN 2.1.0

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