This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Fortran testsuite?



  In message <199709140207.WAA28547@nemo.rutgers.edu>you write:
  > It seems to me that one thing that is missing in egcs is a Fortran
  > testsuite.  Is anyone working on one?  I looked a little at the 
  > way it is done for gcc and g++ and I have several questions about
  > it:
I think Craig Burley has something along these lines, except that it
may contain code that shouldn't be released to the public.

If my understanding is correct, someone would need to pour over the
code & bug reports and extract just those testcase which are suitable
for a public audience.

I'm sure Craig will correct me if I'm wrong.

  > 1. It seems like the gcc compile/execute split is a good way to go
  > for Fortran.  Right?  Will we need other directories for other
  > compiler flags (like one for free format code)?
It's a reasonable start.  There's other stuff that's more complicated;
for example one could use specfp92 (all the programs are publicly
avaiable, you just need reference inputs and outputs).  Similarly for
other benchmarking code which contains sample input and output.


  > 2. Here is an example of something that once failed in g77:
  > 
  >       program complex_1
  >       complex      z0, z1, z2
  > 
  >       z0 = cmplx(0.,.5)
  >       z1 = 1./z0
  >       if (z1 .ne. cmplx(0.,-2)) stop 1
  > 
  >       z0 = 10.*z0
  >       if (z0 .ne. cmplx(0.,5.)) stop 2
  > 
  >       z2 = cmplx(1.,2.)
  >       z1 = z0/z2
  >       if (z1 .ne. cmplx(2.,1.)) stop 3
  > 
  >       z1 = z0*z2
  >       if (z1 .ne. cmplx(-10.,5.)) stop 4
  >       end
  > 
  > If it fails, it will print "STOP 1 statement reached", but the return
  > code to the OS is zero.  An alternate is to replace "stop 1" with
  > "call exit(1)" but this uses the library and will fail if the library
  > isn't built right.  Any comment?
Well, my tempation would be to go ahead and call exit (1).

Most of the time fortran is only used on native systems, and you can
probably assume that you'll have suitable libraries since they're
build at the same time as g77.

The area where you run into trouble is simulator and target board testing.
Luckily we have some pretty neat features in ld & the testing harnes which
will allows us to redefine exit to print a pass/fail message (or whatever we
want) and the testing harness can look for those messages.

  > 3. I copied lib/gcc.exp to lib/g77.exp and changed gcc to g77, but
  > libgloss doesn't have a find_g77 in it.  I also looked at g++.exp for
  > how to find the compiler, but I'm still stuck.
I'd avoid g++.exp since it works in an entirely different fashion.
gcc/testsuite/lib/c-torture.exp is probably the thing you'd want to look at.

  > I'm willing to put some time into this, but I'll need some guidance in
  > order to make it fit in with the existing structure.  I'm rather a
  > novice at tcl/expect.
Craig is probably the man to talk to about putting together a fortan
testsuite.  It's something I'd certainly like to see us start working on.

jeff


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