Skip to content

Commit 95a9f0d

Browse files
authored
[Fortran/gfortran][NFC] Update README.md (#108)
* [Fortran/gfortran][NFC] Update README.md Remove references to the "old" way of doing things which has now been removed. Add text describing the correct handling of directives. Add notes describing some other limitations that would be good to remove.
1 parent eb52edb commit 95a9f0d

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

Fortran/gfortran/README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ behavior of the binary produced by the compiler.
1616
Currently, only the _execute_ tests are supported in `regression`. Both
1717
`compile` and `execute` tests have been enabled in `torture`.
1818

19-
Of the supported tests, a number of tests have been disabled. There are four
19+
Of the supported tests, a number of tests have been disabled. These are listed
20+
in the `DisabledFiles.cmake` files that can be found in the various
21+
subdirectories of `Fortran/gfortran`. There are four
2022
categories of such tests:
2123

2224
- *Unsupported*: These are tests that use non-standard extensions/intrinsics
@@ -129,19 +131,13 @@ implemented at a steady pace. The relevant tests in this directory should be
129131
enabled. This would involve building the test suite with one of the
130132
`TEST_SUITE_FORTRAN_*` flags described above.
131133

132-
_*NOTE*: We are currently in the process of migrating to the static test
133-
configuration described below. During that time, the configuration files and
134-
associated scripts will be present in the repository but will not be used. When
135-
the migration is completed, this note will be removed._
136-
137134
The build system uses static test configuration files named `tests.cmake` to be
138135
found in the various subdirectories of the test suite. These are generated by
139136
`utils/update-test-config.py`. The configuration files are the result of parsing
140137
the relevant DejaGNU annotations from the test files and are used by the various
141-
`CMakeLists.txt` files to set up the tests. This was a lot easier --- and
142-
cleaner --- than parsing the annotations from `cmake`. These configuration files
143-
are not intended to be edited by hand - any edits will be overwritten when
144-
`update-test-config.py` is run.
138+
`CMakeLists.txt` files to set up the tests. These configuration files *must not*
139+
be edited by hand - any edits will be overwritten when `update-test-config.py`
140+
is run.
145141

146142
The test configuration files consist of comment and non-comment lines. Comment
147143
lines start with a `#`. Each non-comment line represents a single test. The line
@@ -182,7 +178,9 @@ The test files in `regression` and `torture` *must not* be modified.
182178
If some of the items listed here are implemented, even in part, it should
183179
allows us to make better use of the test-suite.
184180

185-
Several DejaGNU directives from the test files are currently ignored. In some
181+
Several DejaGNU directives from the test files are either ignored or only
182+
partially supported - i.e. only a subset of the options specified by the
183+
directive are handled correctly. In some
186184
cases, those directives check that the language feature/optimization being
187185
exercised by the tests is actually handled correctly. By ignoring them, we are
188186
simply checking that `flang` (or the code produced by it) does not crash at
@@ -196,7 +194,7 @@ vectorized the code.
196194
It is not clear how much effort would be involved in correctly handling all the
197195
DejaGNU directives.
198196

199-
### `dg-error` directive ###
197+
#### `dg-error` directive ####
200198

201199
The `dg-error` directive indicates that the test should fail to compile with a
202200
particular error. Obviously, this is a `gfortran`-specific error. `flang` may
@@ -210,7 +208,7 @@ are currently not implemented which results in a parse error (as opposed to the
210208
triggering of a "not-yet-implemented" assertion) which is also deemed an "error",
211209
thereby causing the test to pass.
212210

213-
### `dg-warning` directive ###
211+
#### `dg-warning` directive ####
214212

215213
Currently, the `dg-warning` directive is ignored. It ought to be possible to
216214
treat in a manner similar to `dg-error`.
@@ -227,15 +225,27 @@ the file for the presence or absence of certain text. To capture the same
227225
behavior here, we would need to parse and translate the internal representation
228226
of GCC to an equivalent representation in LLVM IR.
229227

230-
### `target` directive ###
228+
#### `target` directive ####
229+
230+
The `target` directive is used to restrict tests to run on certain platforms
231+
and/or systems. The directive can be fairly complex. While in most cases the
232+
directive simply consists of a triple specifying the platform on which the
233+
test is enabled (or disabled), negations, logical `and` and `or` operations are
234+
also permitted. The directives can appear in several places within
235+
a test file. In addition to "top-level" directives which control whether or
236+
not the entire test is enabled, a `target` directive can also be used to
237+
conditionally emit or suppress an error or a warning on certain platforms.
238+
Currently, there is limited support for these directives.
239+
240+
- Logical operators on `target` directives are not supported. Directives
241+
containing these operators are ignored entirely.
242+
243+
- Only "top-level" directives are handled. `target` directives that appear
244+
inside other directives such as `dg-error` or `dg-warning` are ignored.
231245

232-
_*NOTE*: With the static test configuration, the "top-level" `target` directives
233-
are correctly handled. This section will be updated when the switch to the
234-
static test configurations is completed._
246+
#### Platform-specific disabling of tests ####
235247

236-
The `target` directive is used to restrict tests to run on certain
237-
platforms/systems. Currently, the target directive is ignored entirely and the
238-
tests are always run. Currently, the gfortran tests are only enabled on *nix on
239-
x86-64 and aarch64 and ignoring the directive seems to be ok. As support for
240-
more systems and architectures are added, these directives will need to be
241-
handled correctly.
248+
Some tests fail on certain platforms but not on others. There is, currently, no
249+
way to disable these tests on a specific platform and these are disabled
250+
everywhere. This is obviously not ideal since the extra coverage that the tests
251+
provide — even if on a limited set of platforms — is desirable.

0 commit comments

Comments
 (0)