1! { dg-do run }
2! At one point, SIGN() evaluated its first argument twice.
3! Contributed by Brooks Moses <brooks.moses@codesourcery.com>
4program sign1
5  integer :: i
6  i = 1
7  if (sign(foo(i), 1) /= 1) call abort
8  i = 1
9  if (sign(foo(i), -1) /= -1) call abort
10contains
11  integer function foo(i)
12    integer :: i
13    foo = i
14    i = i + 1
15  end function
16end
17