Skip to content

Commit 4a13813

Browse files
authored
[Fortran/gfortran] Remove HLFIR-specific allow and deny lists
The code that supports "feature-specific" testing has been retained, but has been tweaked a little bit. The README has been updated with some examples.
1 parent 7922947 commit 4a13813

36 files changed

+36
-352
lines changed

Fortran/gfortran/CMakeLists.txt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -473,28 +473,25 @@ function(gfortran_populate_disabled_tests out)
473473
list(APPEND skipped ${SKIPPED_FILES})
474474
list(APPEND failing ${FAILING_FILES})
475475

476-
# do the same for any requested feature extentions
476+
# do the same for any requested feature extensions
477477
foreach(feature ${TEST_SUITE_FORTRAN_FEATURES})
478478
set(UNSUPPORTED_FILES "")
479479
set(UNIMPLEMENTED_FILES "")
480480
set(SKIPPED_FILES "")
481481
set(FAILING_FILES "")
482-
include(${CMAKE_CURRENT_SOURCE_DIR}/DisabledFiles${feature}.cmake)
482+
include(${CMAKE_CURRENT_SOURCE_DIR}/DisabledFiles_${feature}.cmake)
483483
list(APPEND unsupported ${UNSUPPORTED_FILES})
484484
list(APPEND unimplemented ${UNIMPLEMENTED_FILES})
485485
list(APPEND skipped ${SKIPPED_FILES})
486486
list(APPEND failing ${FAILING_FILES})
487487

488488
# enable any tests that now pass for this feature
489-
set(SUPPORTED_FILES "")
490-
set(IMPLEMENTED_FILES "")
491-
set(UNSKIPPED_FILES "")
492-
set(PASSING_FILES "")
493-
include(${CMAKE_CURRENT_SOURCE_DIR}/EnabledFiles${feature}.cmake)
494-
list(REMOVE_ITEM unsupported ${SUPPORTED_FILES})
495-
list(REMOVE_ITEM unimplemented ${IMPLEMENTED_FILES})
496-
list(REMOVE_ITEM skipped ${UNSKIPPED_FILES})
497-
list(REMOVE_ITEM failing ${PASSING_FILES})
489+
set(ENABLED_FILES "")
490+
include(${CMAKE_CURRENT_SOURCE_DIR}/EnabledFiles_${feature}.cmake)
491+
list(REMOVE_ITEM unsupported ${ENABLED_FILES})
492+
list(REMOVE_ITEM unimplemented ${ENABLED_FILES})
493+
list(REMOVE_ITEM skipped ${ENABLED_FILES})
494+
list(REMOVE_ITEM failing ${ENABLED_FILES})
498495
endforeach()
499496

500497
set(disabled "")
@@ -511,7 +508,7 @@ function(gfortran_populate_disabled_tests out)
511508
# and unimplemented tests since some could be enabled once some feature is
512509
# implemented. Eventually, all the TEST_SUITE_FORTRAN_FORCE_* options (perhaps
513510
# with the exception of TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS) should
514-
# become redundant and removed.
511+
# become redundant and should be removed.
515512
if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND
516513
NOT TEST_SUITE_FORTRAN_FORCE_UNIMPLEMENTED_TESTS)
517514
list(APPEND disabled ${unimplemented})

Fortran/gfortran/README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,35 @@ are unrelated to the gfortran tests here.
115115
### Testing non-standard features/flags
116116

117117
Additional denylists for a particular feature can be included by creating
118-
DisabledFilesFEATURE.cmake files (in the same format as those for the default
119-
denylists), and adding FEATURE to `TEST_SUITE_FORTRAN_FEATURES`. Additional
120-
compiler flags can be added using `CMAKE_Fortran_FLAGS`.
118+
`DisabledFiles_FEATURE.cmake` files (in the same format as those for the default
119+
denylists, `DisabledFiles.cmake`), and adding FEATURE to
120+
`TEST_SUITE_FORTRAN_FEATURES`. Additional compiler flags can be added using
121+
`CMAKE_Fortran_FLAGS`.
121122

122-
For example, to test HLFIR one could use
123-
`CMAKE_Fortran_Flags=-flang-experimental-hlfir` and
124-
`TEST_SUITE_FORTRAN_FEATURES=HLFIR`.
123+
For example, to test feature, FOO, one could use
125124

125+
```
126+
cmake -DTEST_SUITE_FORTRAN_FEATURES=FOO \
127+
-DCMAKE_Fortran_FLAGS=-some-foo-specific-flag-if-required \
128+
<other cmake flags>
129+
```
130+
131+
`DisabledFiles_FOO.cmake` files can be created in the appropriate subdirectories
132+
if enabling the feature/flag results in the failure of tests that otherwise pass.
133+
Conversely, the feature/flag may cause some disabled tests to pass. These can be
134+
added to an allowlist file, `EnabledFiles_FOO.cmake` in the corresponding
135+
directory. The file must contain a single variable named `ENABLED_FILES` with
136+
the file names of the tests that should be enabled (in the case of multi-file
137+
tests, this should be the name of the "main" file). An example of such a list is
138+
below.
139+
140+
```
141+
file(GLOB ENABLED_FILES CONFIGURE_DEPENDS
142+
test_1.f90
143+
multifile-main.f03
144+
)
145+
146+
```
126147

127148
### Notes for developers/maintainers ###
128149

Fortran/gfortran/regression/DisabledFilesHLFIR.cmake

Lines changed: 0 additions & 59 deletions
This file was deleted.

Fortran/gfortran/regression/EnabledFilesHLFIR.cmake

Lines changed: 0 additions & 37 deletions
This file was deleted.

Fortran/gfortran/regression/analyzer/DisabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

Fortran/gfortran/regression/analyzer/EnabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

Fortran/gfortran/regression/asan/DisabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

Fortran/gfortran/regression/asan/EnabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

Fortran/gfortran/regression/c-interop/DisabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

Fortran/gfortran/regression/c-interop/EnabledFilesHLFIR.cmake

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)