This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [FORTRAN PATCH]: Improved integer SIGN intrinsic (& bug-fix)


Brooks Moses wrote:
Here, try this:

! { dg-do run }
! At one point, SIGN() evaluated its first argument twice.
program sign1
   integer :: i = 1
   if (sign(foo(i), 1) /= 1) call abort

Er, right. This also needs an "i = 1" line inserted here.


   if (sign(foo(i), -1) /= -1) call abort
contains
   integer function foo(i)
     integer :: i
     foo = i
     i = i + 1
   end function
end

- Brooks



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]