Skip to content

[Fortran/gfortran] Switch to using the static test configuration files #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
446 changes: 238 additions & 208 deletions Fortran/gfortran/CMakeLists.txt

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
set(PREFIX_EXECUTE "gfortran-regression-execute")
set(PREFIX_COMPILE "gfortran-regression-compile")

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()

add_subdirectory(analyzer)
add_subdirectory(asan)
Expand Down
85 changes: 85 additions & 0 deletions Fortran/gfortran/regression/DisabledFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,30 @@ file(GLOB SKIPPED_FILES CONFIGURE_DEPENDS
pr93524.f90
public_private_module_3.f90
static_linking_1.f

# ----------------------------------------------------------------------------
#
# These files are only intended to be run on AArch64, but we don't currently
# process the target attribute, so these are disabled everywhere. When the
# DejaGNU target attribute is handled correctly, these should be removed from
# here.
pr101158.f90
pr88833.f90
pr98974.F90
Comment on lines +1797 to +1803
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these tests passing by luck on other targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests have additional flags that use -march or -mcpu options whose values are not valid on x86-64. These used to work because both the target annotations and the flags were ignored before. I think the target attribute is handled correctly in this patch. These are probably tests that got added by accident (see the note above). I can double check and remove it right now. Otherwise, they should get removed in the next patch which will enable number of tests that now pass.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's ok to leave them disabled while we don't support the target attribute. I was just curious to know whether they worked on other targets before, but there is no need to dig further into this.


# ----------------------------------------------------------------------------
#
# These tests have a -J flag but the build system adds a -J of its own and
# exactly one is allowed. If the build system is changed, these can be removed
# from here.
Comment on lines +1807 to +1809
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By build system do you mean the set of CMake files for the gfortran test suite? And that some adjustments on these are needed to properly support -J?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

It has to do with the way the gfortran tests are built. There are several tests which generate .mod files with the same name which causes race conditions in parallel builds. To work around this, there is a unique working directory for each test and I ended up adding a -J flag when building the tests. There might be a way to do it without requiring a -J flag, but I haven't gotten around to looking into it yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. As -J was already used before, is this another case of tests that worked by accident?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, in this case, the flags were not being passed while building the test at all because the DejaGNU annotation containing it was not being parsed correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I took a look at the include tests below and saw that they expect some warnings to be emitted (or omitted), which is a kind of test that we don't support anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

You have identified several limitations with the way we are using the gfortran tests. One of the improvements that can be made is to map gfortran warnings to equivalent flang warnings where possible and check for those. Currently, warnings are completely ignored.

We do check for the presence of an error when a test is expected to produce one, but we do not check if it is an "equivalent" error. That can be improved as well.

include_14.f90
include_15.f90
include_16.f90
include_17.f90
include_18.f90
include_19.f90
include_20.f90
include_8.f90
)

# These tests are disabled because they fail when they are expected to pass.
Expand Down Expand Up @@ -1820,6 +1844,23 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
Wall.f90 # no warning for missing & on continuation line in char constant
Wno-all.f90 # no warning for missing & on continuation line in char constant
bessel_7.f90 # unclear
bounds_check_10.f90
bounds_check_7.f90
bounds_check_array_ctor_1.f90
bounds_check_array_ctor_2.f90
bounds_check_array_ctor_6.f90
bounds_check_array_ctor_7.f90
bounds_check_array_ctor_8.f90
bounds_check_fail_4.f90
bounds_check_strlen_1.f90
bounds_check_strlen_2.f90
bounds_check_strlen_3.f90
bounds_check_strlen_4.f90
bounds_check_strlen_5.f90
bounds_check_strlen_7.f90
char_bounds_check_fail_1.f90
char_pointer_assign_4.f90
char_pointer_assign_5.f90
check_bits_1.f90 # requires -fcheck=bits to catch ISHFTC runtime error
check_bits_2.f90 # requires -fcheck=bits to catch ISHFTC runtime error
internal_dummy_2.f08 # causes flang-new to crash llvm-project/issues/76927
Expand All @@ -1828,10 +1869,16 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
dollar_edit_descriptor_4.f # TODO: (i3,$) format shouldn't advance record when looping
list_read_11.f90 # more CR character shenanigans
matmul_5.f90
matmul_bounds_10.f90
matmul_bounds_11.f90
matmul_bounds_13.f90
matmul_bounds_15.f
matmul_bounds_16.f
matmul_bounds_2.f90
matmul_bounds_3.f90
matmul_bounds_4.f90
matmul_bounds_5.f90
matmul_bounds_8.f90
matmul_bounds_7.f90
matmul_bounds_9.f90
maxloc_2.f90
Expand All @@ -1841,6 +1888,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
maxlocval_2.f90
maxlocval_4.f90
merge_bits_2.F90
merge_char_3.f90
minloc_1.f90
minlocval_1.f90
minlocval_4.f90
Expand Down Expand Up @@ -1880,6 +1928,11 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
pr96436_3.f90
pr96436_4.f90
pr96436_5.f90
pr96436_6.f90
pr96436_7.f90
pr96436_8.f90
pr96436_9.f90
pr96436_10.f90
promotion_3.f90
promotion_4.f90
promotion.f90
Expand Down Expand Up @@ -1911,7 +1964,10 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
real8-4.f90
real_const_3.f90
realloc_on_assign_11.f90
recursive_check_11.f90
recursive_check_13.f90
recursive_check_7.f90
recursive_check_9.f90
repeat_1.f90
reshape_order_1.f90
reshape_order_2.f90
Expand All @@ -1925,10 +1981,12 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
streamio_17.f90
streamio_4.f90
system_clock_3.f08
transpose_2.f90
unf_io_convert_4.f90
unf_read_corrupted_1.f90
unf_short_record_1.f90
unformatted_subrecord_1.f90
unpack_bounds_1.f90
unpack_bounds_2.f90
unpack_bounds_3.f90
utf8_1.f03
Expand All @@ -1954,10 +2012,37 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
entry_23.f
findloc_8.f90

# ---------------------------------------------------------------------------
#
# These tests are expected to raise a runtime error, but currently don't.

allocate_error_1.f90
cshift_bounds_2.f90
deallocate_error_1.f90
deallocate_error_2.f90
do_check_2.f90
do_check_3.f90
do_check_4.f90
do_check_11.f90
do_check_12.f90
endfile_4.f90
fmt_g0_2.f08
inline_sum_bounds_check_1.f90
inline_sum_bounds_check_2.f90
io_real_boz2.f90
io_real_boz_4.f90
io_real_boz_5.f90
no_unit_error_1.f90
pointer_check_10.f90
pointer_remapping_6.f08

# ---------------------------------------------------------------------------
#
# Compilation of these tests is expected to fail, but it succeeds instead.

binding_label_tests_26b.f90
test_common_binding_labels_2_main.f03

# Tests that exercise gfortran's ability to set -std=f95 and then see errors on newer features
abstract_type_1.f90
alloc_comp_constraint_7.f90
Expand Down
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/asan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/c-interop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/coarray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/debug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/g77/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/goacc-gomp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}" FFLAGS -fopenacc -fopenmp)
gfortran_populate_tests(FFLAGS -fopenacc -fopenmp)
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/goacc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}" FFLAGS -fopenacc)
gfortran_populate_tests(FFLAGS -fopenacc)
2 changes: 1 addition & 1 deletion Fortran/gfortran/regression/goacc/DisabledFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ file(GLOB UNIMPLEMENTED_FILES CONFIGURE_DEPENDS
# These tests are disabled because they cause flang to crash.
file(GLOB SKIPPED_FILES CONFIGURE_DEPENDS
# error: unsupported OpenACC operation:
acc.bounds array-with-dt-1a.f90
array-with-dt-1a.f90
array-with-dt-1.f90
array-with-dt-2.f90
array-with-dt-3.f90
Expand Down
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/gomp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}" FFLAGS -fopenmp)
gfortran_populate_tests(FFLAGS -fopenmp)
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/gomp/appendix-a/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}" FFLAGS -fopenmp)
gfortran_populate_tests(FFLAGS -fopenmp)
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/ieee/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/lto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/ubsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
5 changes: 1 addition & 4 deletions Fortran/gfortran/regression/vect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests_from("${TESTS}")
gfortran_add_compile_tests_from("${TESTS}")
gfortran_populate_tests()
4 changes: 1 addition & 3 deletions Fortran/gfortran/torture/compile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_compile_tests("${TESTS}")
gfortran_populate_tests()
4 changes: 1 addition & 3 deletions Fortran/gfortran/torture/execute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
#
#===------------------------------------------------------------------------===#

set(TESTS)
gfortran_populate_tests(TESTS)
gfortran_add_execute_tests("${TESTS}")
gfortran_populate_tests()