Hi Jerry!

Am 20.10.24 um 18:56 schrieb Jerry D:
The attached diff file begins some test suite cleanup.

The patch removes extra spaces between dg-do and the run directive, I only have gone through gfortran.dg and not its sub-directories. Interestingly, one of the tests fails when this space is removed. I fixed that by adding in a -O in the dg-options.

There was already a discussion of the "two spaces" vs. "one space"
version of dg-do run; see e.g. the thread starting here:

https://gcc.gnu.org/pipermail/fortran/2024-March/060363.html

(see also Andrew's remark:
https://gcc.gnu.org/pipermail/fortran/2024-April/060400.html)

I learned that the "two spaces" hack^Wversion has its (undocumented)
uses, namely a test is only run once.  Has anybody attempted to adjust
the testsuite documentation?  I find the possibility to run a certain
test only once interesting, especially if only a runtime library feature
is tested, and this saves (a little) testsuite execution time, which I
find to have been increasing quite a lot recently.

(One of the possible solutions was to have the two spaces, but also
a comment that no cycling is intended.  As long are there is no other
solution to this hack.)

The PR is not about the extra spaces. Interestingly it is recommended in comment #3 that the -O0 which are superfluous be removed everywhere. I plan to make additional passes through the tests to clean out the -O and -O0 directives as suggested and see what the result is. I also plan to go through the sub-directories as well. (ie more patches will follow as I have time.)

I think that reviewing the appropriateness of the specifications of the
tests is a good thing.  That should happen before plainly changing the
dg-directives.

One thing to remember: in the gfortran frontend, cycling through the
optimization levels switches several flags controlling e.g. frontend
optimization, matmul inlining, ...  In particular the test

gcc/testsuite/gfortran.dg/inline_matmul_1.f90

*requires* matmul inlining.  So you want either run this test only
with options that enable this inlining.  Optimization is not the point
here.  And one of the essential points of this test is the last line:

! { dg-final { scan-tree-dump-times "_gfortran_matmul" 0 "optimized" } }

Now if you explicitly add -O, what is the point of cycling through the
optimization levels?

Cheers,
Harald

The effect of removing the extra space is additional tests on the test case are run. [aside: I found one test case that had its executable bit set so I corrected it as well.]

Regression tested on x86-64-linux-gnu. OK for trunk?

Author: Jerry DeLisle <jvdeli...@gcc.gnu.org>
Date:   Sat Oct 19 19:29:22 2024 -0700

     Fortran: Remove extra space from dg-do run directives.

     gcc/testsuite/ChangeLog:

             PR fortran/28031
             * gfortran.dg/ISO_Fortran_binding_4.f90: Delete extra space
             in dg-do run directive.
             * gfortran.dg/abort_shouldfail.f90: Likewise.
             * gfortran.dg/adjustl_1.f90: Likewise.
             * gfortran.dg/allocate_with_mold_3.f90: Likewise.
             * gfortran.dg/allocate_with_source_6.f90: Likewise.
             * gfortran.dg/altreturn_9_0.f90: Likewise.
             * gfortran.dg/array_constructor_52.f90: Likewise.
             * gfortran.dg/array_constructor_53.f90: Likewise.
             * gfortran.dg/array_simplify_2.f90: Likewise.
             * gfortran.dg/array_simplify_3.f90: Likewise.
             * gfortran.dg/block_14.f90: Likewise.
             * gfortran.dg/bound_9.f90: Likewise.
             * gfortran.dg/bounds_check_20.f90: Likewise.
             * gfortran.dg/c_funptr_1_mod.f90: Likewise.
             * gfortran.dg/char_result_mod_19.f90: Likewise.
             * gfortran.dg/coarray_data_1.f90: Likewise.
             * gfortran.dg/contiguous_8.f90: Likewise.
             * gfortran.dg/cray_pointers_2.f90: Likewise.
             * gfortran.dg/cshift_1.f90: Likewise.
             * gfortran.dg/cshift_2.f90: Likewise.
             * gfortran.dg/data_derived_1.f90: Likewise.
            * gfortran.dg/dec_union_12.f90: Remove executable bit from file
             permissions.
             * gfortran.dg/dependency_50.f90: Likewise.
             * gfortran.dg/dependency_51.f90: Likewise.
             * gfortran.dg/dependency_54.f90: Likewise.
             * gfortran.dg/derived_init_5.f90: Likewise.
             * gfortran.dg/dim_sum_1.f90: Likewise.
             * gfortran.dg/dim_sum_2.f90: Likewise.
             * gfortran.dg/dim_sum_3.f90: Likewise.
             * gfortran.dg/eoshift_3.f90: Likewise.
             * gfortran.dg/eoshift_4.f90: Likewise.
             * gfortran.dg/eoshift_5.f90: Likewise.
             * gfortran.dg/eoshift_6.f90: Likewise.
             * gfortran.dg/execute_command_line_3.f90: Likewise.
             * gfortran.dg/findloc_5.f90: Likewise.
             * gfortran.dg/implied_do_io_4.f90: Likewise.
             * gfortran.dg/implied_do_io_5.f90: Likewise.
             * gfortran.dg/implied_do_io_6.f90: Likewise.
             * gfortran.dg/inline_matmul_1.f90: Likewise.
             * gfortran.dg/inline_matmul_10.f90: Likewise. Add -O option.
             * gfortran.dg/inline_matmul_11.f90: Likewise.
             * gfortran.dg/inline_matmul_17.f90: Likewise.
             * gfortran.dg/inline_matmul_18.f90: Likewise.
             * gfortran.dg/inline_matmul_19.f90: Likewise.
             * gfortran.dg/inline_matmul_20.f90: Likewise.
             * gfortran.dg/inline_matmul_3.f90: Likewise.
             * gfortran.dg/inline_matmul_4.f90: Likewise.
             * gfortran.dg/inline_matmul_5.f90: Likewise.
             * gfortran.dg/inline_matmul_7.f90: Likewise.
             * gfortran.dg/inline_matmul_8.f90: Likewise.
             * gfortran.dg/inline_matmul_9.f90: Likewise.
             * gfortran.dg/intent_out_12.f90: Likewise.
             * gfortran.dg/internal_readwrite_4.f90: Likewise.
             * gfortran.dg/is_contiguous_2.f90: Likewise.
             * gfortran.dg/is_contiguous_3.f90: Likewise.
             * gfortran.dg/matmul_15.f90: Likewise.
             * gfortran.dg/matmul_16.f90: Likewise.
             * gfortran.dg/matmul_19.f90: Likewise.
             * gfortran.dg/matmul_blas_1.f: Likewise.
             * gfortran.dg/matmul_bounds_14.f: Likewise.
             * gfortran.dg/matmul_bounds_15.f: Likewise.
             * gfortran.dg/matmul_bounds_16.f: Likewise.
             * gfortran.dg/matmul_const.f90: Likewise.
             * gfortran.dg/maxloc_4.f90: Likewise.
             * gfortran.dg/maxval_parameter_1.f90: Likewise.
             * gfortran.dg/min_max_type.f90: Likewise.
             * gfortran.dg/min_max_type_2.f90: Likewise.
             * gfortran.dg/minloc_4.f90: Likewise.
             * gfortran.dg/minmaxloc_12.f90: Likewise.
             * gfortran.dg/minmaxloc_13.f90: Likewise.
             * gfortran.dg/minmaxloc_8.f90: Likewise.
             * gfortran.dg/minmaxloc_zerosize_1.f90: Likewise.
             * gfortran.dg/minval_char_5.f90: Likewise.
             * gfortran.dg/minval_parameter_1.f90: Likewise.
             * gfortran.dg/open_errors_3.f90: Likewise.
             * gfortran.dg/parameter_array_format.f90: Likewise.
             * gfortran.dg/recursive_check_16.f90: Likewise.
             * gfortran.dg/shape_9.f90: Likewise.
             * gfortran.dg/simplify_cshift_4.f90: Likewise.
             * gfortran.dg/simplify_eoshift_1.f90: Likewise.
             * gfortran.dg/stop_shouldfail.f90: Likewise.
             * gfortran.dg/structure_constructor_14.f90: Likewise.
             * gfortran.dg/substr_7.f90: Likewise.
             * gfortran.dg/zero_sized_9.f90: Likewise.


Reply via email to