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]

FAIL of specifics.f90


Hi,

The test suite failure on amd64 of specifics.f90 can be
reduced to the following smaller test case:

subroutine test_dprod(fn)
  if (abs (fn (2.0, 3.0) - 6d0) .gt. 0.00001) call abort
end subroutine

program specifics
  intrinsic dprod
  call test_dprod(dprod)
end program

How can test_dprod know that the function result of fn is
a double precision?  As far as I can tell, it cannot, and
indeed, if I rework the test case as follows:

subroutine test_dprod(fn)
  implicit double precision (f)
  if (abs (fn (2.e0, 3.e0) - 6d0) .gt. 0.00001) call abort
end subroutine

program specifics
  intrinsic dprod
  call test_dprod(dprod)
end program

Now the test case passes.
(Adding an interface also helps btw, for all of you who share
my disgust of implicit typing ;-)

So, is the test case just wrong, or am I missing something?

Gr.
Steven



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