This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Improving code coverage of the testsuite
On Thu, Nov 04, 2010 at 08:46:46AM -0700, Steve Kargl wrote:
> On Thu, Nov 04, 2010 at 04:22:54PM +0100, Tobias Schl?ter wrote:
> >
> > Hi,
> >
> > On 2010-11-04 16:03, Davis, Jimmie wrote:
> > >Hello All,
> > >
> > >As part of a class assignment, I have been analysing the testing coverage
> > >of gfortran by the testsuite.
> > >
> > >Looking at this hunk of code (from check.c), it is straightforward to add
> > >a test that triggers the eror message. But, the chunk in the middle is a
> > >different story; After some time digging through the source, I think it is
> > >'dead code', and will never be executed.
> > >
> > >"I think" is sure not enough evidence to delete. But, I would like to at
> > >least record the effort currently expended. It would be ugly to add more
> > >noise to the source. How about a wiki page or something ?
> > >
> > >Or should we not worry about dead code ? Ideas ?
> >
> >
> > Can't you trigger it with something like
> > FUNCTION f(c)
> > IMPLICIT CHARACTER*4 (a-z)
> > print *, sin(c)
> > END
> > ?
>
> Nope.
>
> troutmask:sgk[212] gfc4x -c d.f
> d.f:3.21:
>
> print *, sin(c)
> 1
> Error: 'x' argument of 'sin' intrinsic at (1) must be REAL or COMPLEX
>
Try this one.
FUNCTION f(c)
IMPLICIT LOGICAL*4 (a-z)
print *, range(c)
END
troutmask:sgk[204] gfc4x -c d.f
d.f:3.23:
print *, range(c)
1
Error: 'x' argument of 'range' intrinsic at (1) must be a numeric type
It seems that numeric_check() is only used in gfc_check_range(),
gfc_check_real(), gfc_check_abs(), gfc_check_cmplx(), gfc_check_dcmplx(),
gfc_check_dble(), gfc_check_dot_product(), gfc_check_int(),
gfc_check_intconv(), and gfc_check_product_sum(). Some (or maybe all)
of these can probably be made to use gfc_numeric_ts().
--
Steve