This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix intrinsic_spacing.f90
- From: Richard Henderson <rth at twiddle dot net>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Jul 2004 14:58:10 -0700
- Subject: fix intrinsic_spacing.f90
This test case has two flaws:
(1) Passing integers where real arguments expected,
(2) Writing to arguments that were given constants.
Exposed by a patch I'm working on...
Ok?
r~
* gfortran.fortran-torture/execute/intrinsic_spacing.f90: Pass
arguments in the correct type. Don't write to constant arguments.
Index: testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.f90
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.f90,v
retrieving revision 1.2
diff -u -p -r1.2 intrinsic_spacing.f90
--- testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.f90 13 May 2004 06:40:53 -0000 1.2
+++ testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.f90 28 Jul 2004 21:53:01 -0000
@@ -4,15 +4,16 @@ program test_spacing
call test_real4(3.0)
call test_real4(33.0)
call test_real4(-3.)
- call test_real4(0)
- call test_real8(0)
+ call test_real4(0.0)
+ call test_real8(0.0_8)
call test_real8(3.0_8)
call test_real8(33.0_8)
call test_real8(-33._8)
end
-subroutine test_real4(x)
- real x,y,t
+subroutine test_real4(orig)
+ real x,y,t,orig
integer p
+ x = orig
p = 24
y = 2.0 ** (exponent (x) - p)
t = tiny(x)
@@ -21,9 +22,10 @@ subroutine test_real4(x)
.and. (abs (x - t) .gt. abs(x * 1e-6)))call abort
end
-subroutine test_real8(x)
- real*8 x,y,t
+subroutine test_real8(orig)
+ real*8 x,y,t,orig
integer p
+ x = orig
p = 53
y = 2.0 ** (exponent (x) - p)
t = tiny (x)