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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-O -fdump-tree-original" }
3
program main
4
  integer, parameter :: n=100
5
  real, parameter :: pi=4*atan(1.)
6
  real, parameter :: tmax=20.
7
  real, parameter :: dt = tmax/(2*pi)/real(n)
8
  real, parameter :: t0 = dt/30.
9
  integer :: i
10
  interface
11
     pure function purefunc(x)
12
       real :: purefunc
13
       real, intent(in) :: x
14
     end function purefunc
15
  end interface
16
  real :: a(n)
17
  do i=1,n
18
     a(i) = purefunc(dt*i + t0) * 3. + 2 * purefunc(t0 + i*dt)
19
  end do
20
  print *,a
21
end program main
22
! { dg-final { scan-tree-dump-times "purefunc" 1 "original" } }
23
! { dg-final { cleanup-tree-dump "original" } }

powered by: WebSVN 2.1.0

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