Commit aa9ecf58 by Feng Wang Committed by Steven G. Kargl

intrinsic_set_exponent.f90: Fix nonconformance usage.

2006-09-07  Feng Wang  <fengwang@nudt.edu.cn>

	* gfortran.fortran-torture/execute/intrinsic_set_exponent.f90: Fix
	nonconformance usage.

From-SVN: r116752
parent c9eee440
2006-09-07 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.fortran-torture/execute/intrinsic_set_exponent.f90: Fix
nonconformance usage.
2006-09-07 Andrew Pinski <pinskia@physics.uc.edu> 2006-09-07 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/28862 PR middle-end/28862
...@@ -4,10 +4,11 @@ program test_set_exponent ...@@ -4,10 +4,11 @@ program test_set_exponent
call test_real4() call test_real4()
call test_real8() call test_real8()
end end
subroutine test_real4() subroutine test_real4()
real x,y real*4 x,y
integer i,n integer*4 i,n
equivalence(x,i) equivalence(x, i)
n = -148 n = -148
x = 1024.0 x = 1024.0
...@@ -20,7 +21,8 @@ subroutine test_real4() ...@@ -20,7 +21,8 @@ subroutine test_real4()
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
n = 128 n = 128
i = o'00037777777' i = 8388607
x = transfer (i, x) ! z'007fffff' Positive denormalized floating-point.
y = set_exponent (x, n) y = set_exponent (x, n)
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
...@@ -36,7 +38,8 @@ subroutine test_real4() ...@@ -36,7 +38,8 @@ subroutine test_real4()
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
n = 128 n = 128
i = o'20037777777' i = -2139095041
x = transfer (i, x) ! z'807fffff' Negative denormalized floating-point.
y = set_exponent (x, n) y = set_exponent (x, n)
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
...@@ -45,7 +48,7 @@ end ...@@ -45,7 +48,7 @@ end
subroutine test_real8() subroutine test_real8()
implicit none implicit none
real*8 x, y real*8 x, y
integer*8 i, n, low integer*8 i, n
equivalence(x, i) equivalence(x, i)
n = -1073 n = -1073
...@@ -60,19 +63,14 @@ subroutine test_real8() ...@@ -60,19 +63,14 @@ subroutine test_real8()
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
n = 1024 n = 1024
low = z'ffffffff' i = 4503599627370495_8
i = z'000fffff' x = transfer (i, x) !z'000fffffffffffff' Positive denormalized floating-point.
i = ishft (i, 32) + low !'000fffffffffffff'
y = set_exponent (x, n) y = set_exponent (x, n)
low = z'fffffffe'
i = z'7fefffff'
i = ishft (i, 32) + low
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
n = -1073 n = -1073
x = -1024.0 x = -1024.0
y = set_exponent (x, n) y = set_exponent (x, n)
low = z'00000001'
if ((y .ne. 0.0) .and. (exponent (y) .ne. n)) call abort() if ((y .ne. 0.0) .and. (exponent (y) .ne. n)) call abort()
n = 8 n = 8
...@@ -82,10 +80,8 @@ subroutine test_real8() ...@@ -82,10 +80,8 @@ subroutine test_real8()
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
n = 1024 n = 1024
low = z'ffffffff' i = -9218868437227405313_8
i = z'800fffff' x = transfer (i, x)!z'800fffffffffffff' Negative denormalized floating-point.
i = ishft (i, 32) + low !z'800fffffffffffff'
y = set_exponent (x, n) y = set_exponent (x, n)
if (exponent (y) .ne. n) call abort() if (exponent (y) .ne. n) call abort()
end end
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