nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / leadz_trailz_3.f90
blobc3223c4844e9d739e009b34c0cacd34bfc84417b
1 ! We want to check that ISHFT evaluates its arguments only once
3 ! { dg-do run }
4 ! { dg-options "-fdump-tree-original" }
6 program test
8 if (leadz (foo()) /= bit_size(0) - 1) STOP 1
9 if (leadz (foo()) /= bit_size(0) - 2) STOP 2
10 if (trailz (foo()) /= 0) STOP 3
11 if (trailz (foo()) /= 2) STOP 4
12 if (trailz (foo()) /= 0) STOP 5
13 if (trailz (foo()) /= 1) STOP 6
15 contains
17 integer function foo ()
18 integer, save :: i = 0
19 i = i + 1
20 foo = i
21 end function
23 end program
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
29 ! { dg-final { scan-tree-dump-times "foo *\\\(\\\)" 7 "original" } }