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]

Re: Library testsuite


FX Coudert wrote:
I'll just ask a silly question:
I divided the libgfortran testsuite into two subdirectories [...] the tests in intrinsics cycle through the usual set of options.

If the tests in intrinsics are supposed to cover intrinsics for which code is emitted directly by the front-end, why are we having them in the library testsuite rather than the front-end testsuite?

I think it's probably better to think of this as an "intrinsics" testsuite, which has stuff in it that can be constant-folded, and stuff that's implemented with library calls. Whether we put it under "libgfortran" or "gfortran" is sort of arbitrary, since it's testing both, and I think it's more useful to keep the two halves together.


Here's what I was thinking of:
1. put all I/O tests in an I/O directory in the libgfortran testsuite
2. create also a intrinsics directory, which is run with only one optimization level, and
3. we clearly document the difference, and start moving stuff from gfortran.dg to the libgfortran testsuite slowly, by taking care of whether the test is actually testing front-end emitted code or rather library calls
4. exercise same care when deciding where a new test will end up

I'm not sure that paying that much attention to whether the test is testing front-end folding or library calls is the best approach, really; I don't see that it buys us much. It seems to me that it makes more sense to automatically write two tests for each intrinsic -- one that can in principle be constant-folded relatively easily, and one that cannot.


Yes, that does give us some duplicates for intrinsics that we don't constant-fold (though we could possibly have a means to suppress the foldable ones), but it means that we can autogenerate testcases for the whole suite of intrinsics without having to think about special-casing each one, and I think that's a more useful result.

Then, there should probably be a third directory to hold the various special-case tests that come up from PRs and the like. I think those should be separate from the autogenerated ones, though, and the bulk should be kept as simple to autogenerate as possible.

(We could also, conceivably, have some dump-tree tests that check to make sure that constant-folding actually happens, but I think that's a step 4+N for some positive integer N on your list. :))

FX, who's writing a lot, but it's past 2am and I'm fed up with writing my thesis :)

Heh. Same here, though it's only 6pm here.


- Brooks


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