Improving code coverage of the testsuite

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Nov 4 15:46:00 GMT 2010


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

> 
> The code you quoted sure looks suspicious with the double check for 
> EXPR_VARIABLE anyway, it's definitely bitrotted.
> 

troutmask:sgk[208] svn log -r123643 check.c |more
------------------------------------------------------------------------
r123643 | pault | 2007-04-07 13:20:49 -0700 (Sat, 07 Apr 2007) | 11 lines

2007-04-07  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31222
        * check.c (numeric_check): If an expresson has not got a type,
        see if it is a symbol for which a default type applies.

2007-04-07  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31222
        * gfortran.dg/default_numeric_type_1.f90: New test.

> >--bud davis
> 
> How did that get there?  :)

No kidding!  I thought we may have new blood that
we could lure into a life of gfortran hacking.

-- 
Steve



More information about the Fortran mailing list