[RFC] using autogen to audit fortran intrinsics?!
Bruce Korb
bkorb@gnu.org
Mon Feb 12 22:55:00 GMT 2007
On 2/12/07, Daniel Franke <franke.daniel@gmail.com> wrote:
> a recent discussion on fortran-ml [1] sparked the idea to generate testcases
> to throughly check fortran intrinsics. I assume this might be accomplished
> using autogen?!
Maybe, ...
> The idea: have one or more files that describe the intrinsic routines, a valid
> set of arguments, possibly run time test cases. Pass these files to autogen
> to create test cases suitable for dejagnu. Run the test harness, fix whatever
> pops up.
>
> Could you please have a look at the prototyped block below and comment whether
> this approach could possibly work?
> Example: The BESJ0 intrinsic shall computes the Bessel function of the first
> kind. The argument may be either REAL(4), REAL(8) or REAL(10/16), the return
> type shall be of similar type as the argument.
>
> intrinsic = {
> name = 'besj0';
> # one line per valid argument set
Tiny nit: autogen comments are C++ style.
> function_call = { result_type = 'real_4', argument_type = 'real_4' ; };
> function_call = { result_type = 'real_8', argument_type = 'real_8' ; };
> function_call = { result_type = 'large_real';
> argument_type = 'large_real' ; };
> function_test = { argument_type = 'real_4' ;
> argument_value = '0.0' ;
> result_type = 'real_4' ;
> result_value = '0.0' ;
> tolerance = 'epsilon(real_4)';
> };
> };
>
> From this (or a similar) definition block four or more test files shall be
> generated, two compile time and two runtime checks:
> * compile time checks for all possible argument sets (no arguments, wrong
> type, to many arguments) of which only exact matches to sets described in
> function_call/subroutine_call shall succeed
> * if an intrinsics provides function and subroutine interfaces, both must be
> tested in separate files
> * similar compile time checks for large_real
> * run time checks for real_4/real_8
> * run time checks for large_real
It sounds exactly like what autogen does well. I'd need to look at your
expected output from this one definition in order to figure out how to
derive the transformation rules (template file).
> The partitioning of real_4/real_8 and large_real seems to be necessary as
> dejagnu needs
> { dg-require-effective-target fortran_large_real }
> in the header of any test using large_real -- probably to skip the specific
> tests if the platform does not provide any of these types.
>
>
> Now, suggestions and comments are highly welcome =)
Show me what you want the output files to look like. :)
Cheers - Bruce
More information about the Fortran
mailing list