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

Subversion Repositories openrisc

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

Go to most recent revision | 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 (ishft (foo(), 2) /= 4) call abort
9
  if (ishft (foo(), -1) /= 1) call abort
10
  if (ishft (1, foo()) /= 8) call abort
11
  if (ishft (16, -foo()) /= 1) call abort
12
 
13
  if (ishftc (bar(), 2) /= 4) call abort
14
  if (ishftc (bar(), -1) /= 1) call abort
15
  if (ishftc (1, bar()) /= 8) call abort
16
  if (ishftc (16, -bar()) /= 1) call abort
17
 
18
contains
19
 
20
  integer function foo ()
21
    integer, save :: i = 0
22
    i = i + 1
23
    foo = i
24
  end function
25
 
26
  integer function bar ()
27
    integer, save :: i = 0
28
    i = i + 1
29
    bar = i
30
  end function
31
 
32
end program
33
 
34
! The regexp "foo ()" should be seen once in the dump:
35
!   -- once in the function definition itself
36
!   -- plus as many times as the function is called
37
!
38
! { dg-final { scan-tree-dump-times "foo *\\\(\\\)" 5 "original" } }
39
! { dg-final { scan-tree-dump-times "bar *\\\(\\\)" 5 "original" } }
40
! { 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.