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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! We want to check that ISHFT evaluates its arguments only once
2
!
3
! { dg-do run }
4
! { dg-options "-fdump-tree-original" }
5
 
6
program test
7
 
8
  if (leadz (foo()) /= bit_size(0) - 1) call abort
9
  if (leadz (foo()) /= bit_size(0) - 2) call abort
10
  if (trailz (foo()) /= 0) call abort
11
  if (trailz (foo()) /= 2) call abort
12
  if (trailz (foo()) /= 0) call abort
13
  if (trailz (foo()) /= 1) call abort
14
 
15
contains
16
 
17
  integer function foo ()
18
    integer, save :: i = 0
19
    i = i + 1
20
    foo = i
21
  end function
22
 
23
end program
24
 
25
! The regexp "foo ()" should be seen once in the dump:
26
!   -- once in the function definition itself
27
!   -- plus as many times as the function is called
28
!
29
! { dg-final { scan-tree-dump-times "foo *\\\(\\\)" 7 "original" } }
30
! { 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.