PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / intrinsic_sign_1.f90
bloba5e5ff621c33fa38440d2fd080d29bcbf70ffc30
1 ! { dg-do run }
2 ! At one point, SIGN() evaluated its first argument twice.
3 ! Contributed by Brooks Moses <brooks.moses@codesourcery.com>
4 program sign1
5 integer :: i
6 i = 1
7 if (sign(foo(i), 1) /= 1) STOP 1
8 i = 1
9 if (sign(foo(i), -1) /= -1) STOP 2
10 contains
11 integer function foo(i)
12 integer :: i
13 foo = i
14 i = i + 1
15 end function
16 end