Commit 782700d4 by Richard Henderson Committed by Richard Henderson

intrinsic_nearest.f90: Disable tests of nearest around zero.

        * gfortran.fortran-torture/execute/intrinsic_nearest.f90: Disable
        tests of nearest around zero.

From-SVN: r85361
parent d60bebdd
2004-07-30 Richard Henderson <rth@redhat.com>
* gfortran.fortran-torture/execute/intrinsic_nearest.f90: Disable
tests of nearest around zero.
2004-07-30 Andrew Pinski <apinski@apple.com> 2004-07-30 Andrew Pinski <apinski@apple.com>
* gcc.c-torture/compile/20040730-1.c: New test. * gcc.c-torture/compile/20040730-1.c: New test.
......
!Program to test NEAREST intrinsic function. !Program to test NEAREST intrinsic function.
program test_nearest program test_nearest
real s, r, x, y, inf, max, min real s, r, x, y, inf, max
integer i, infi, maxi integer i, infi, maxi
equivalence (s,i) equivalence (s,i)
equivalence (inf,infi) equivalence (inf,infi)
...@@ -25,19 +25,26 @@ program test_nearest ...@@ -25,19 +25,26 @@ program test_nearest
y = nearest(s, -r) y = nearest(s, -r)
if (.not. (x .gt. s .and. y .lt. s )) call abort() if (.not. (x .gt. s .and. y .lt. s )) call abort()
! ??? This is pretty sketchy, but passes on most targets.
infi = z'7f800000' infi = z'7f800000'
maxi = z'7f7fffff' maxi = z'7f7fffff'
min = tiny(1.0)
call test_up(max, inf) call test_up(max, inf)
call test_up(-inf, -max) call test_up(-inf, -max)
call test_up(0, min)
call test_up(-min, 0)
call test_down(inf, max) call test_down(inf, max)
call test_down(-max, -inf) call test_down(-max, -inf)
call test_down(0, -min)
call test_down(min, 0) ! ??? Here we require the F2003 IEEE_ARITHMETIC module to
! determine if denormals are supported. If they are, then
! nearest(0,1) is the minimum denormal. If they are not,
! then it's the minimum normalized number, TINY. This fails
! much more often than the infinity test above, so it's
! disabled for now.
! call test_up(0, min)
! call test_up(-min, 0)
! call test_down(0, -min)
! call test_down(min, 0)
end end
subroutine test_up(s, e) subroutine test_up(s, e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment