Skip to content

Commit e2db060

Browse files
authored
[NFC][Fortran/gfortran] Add static test configuration files (#84)
[NFC][Fortran/gfortran] Add static test configuration files Add the static test configuration files. This is the first in a series of commits to switch to using a static test configuration for the gfortran tests. The README has been updated to describe the changes that will eventually land and that it is a work-in-progress.
1 parent 85e64d5 commit e2db060

File tree

21 files changed

+8591
-2
lines changed

21 files changed

+8591
-2
lines changed

Fortran/gfortran/README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,50 @@ implemented at a steady pace. The relevant tests in this directory should be
129129
enabled. This would involve building the test suite with one of the
130130
`TEST_SUITE_FORTRAN_*` flags described above.
131131

132-
The test files should be kept in sync with gfortran. This needs to be done
133-
manually periodically.
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+
137+
The build system uses static test configuration files named `tests.cmake` to be
138+
found in the various subdirectories of the test suite. These are generated by
139+
`utils/update-test-config.py`. The configuration files are the result of parsing
140+
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.
145+
146+
The test configuration files consist of comment and non-comment lines. Comment
147+
lines start with a `#`. Each non-comment line represents a single test. The line
148+
consists of semicolon-separated fields as shown below:
149+
150+
```<kind>;<sources>;<xfail>;<options>;<enabled-on>;<disabled-on>```
151+
152+
Each field is described in the table below:
153+
154+
| Field | Description
155+
| :--------------|:----------------------------------------------------------
156+
| `<kind>` | Must be one of 'preprocess', 'assemble', 'compile', 'link' or 'run'.
157+
| `<sources>` | A space separated list of sources files that comprise the test. The first file is the "main" file. The rest of the files must be specified in program compilation order
158+
| `<xfail>` | If present, must be 'xfail' which indicates that the test is expected to trigger a compile-time or runtime error.
159+
| `<options>` | A space separated list of options to be passed to the compiler when building the test.
160+
| `<enabled-on>` | A space-separated list of targets on which the test is enabled. Each element of the list will be a regular expression that is expected to match an LLVM target triple. If no targets are provided, the test is enabled on all targets.
161+
| `<disabled-on>`| A space-separated list of targets on which the test is disabled. Each element of the list will be a regular expression that is expected to match an LLVM target triple.
162+
163+
The test `kind`'s generally reflect what is being tested. For instance,
164+
`preprocess` tests only run the preprocessor, `assemble` tests generate assembly
165+
but no object code, the `compile` tests generate object code but do not invoke
166+
the linker while the `link` tests do invoke the linker. The `run` tests are
167+
"end-to-end" in that the code is compiled, linked and executed. These tests
168+
generally examine the output of the execution to ensure that the behavior of the
169+
generated executable is as expected.
170+
171+
The test files should be kept in sync with gfortran. This has to be done
172+
manually. When performing this update, the test configuration files must be
173+
regenerated. This can be done by running `update-test-config.py` in the root of
174+
the test suite. The `-h` switch can be provided to the script for additional
175+
options.
134176

135177
The test files in `regression` and `torture` *must not* be modified.
136178

@@ -168,6 +210,11 @@ are currently not implemented which results in a parse error (as opposed to the
168210
triggering of a "not-yet-implemented" assertion) which is also deemed an "error",
169211
thereby causing the test to pass.
170212

213+
### `dg-warning` directive ###
214+
215+
Currently, the `dg-warning` directive is ignored. It ought to be possible to
216+
treat in a manner similar to `dg-error`.
217+
171218
#### `scan-tree-dump` directive ####
172219

173220
In the _compile_ tests, the `dg-final { scan-tree-dump* ...}` directives are
@@ -182,6 +229,10 @@ of GCC to an equivalent representation in LLVM IR.
182229

183230
### `target` directive ###
184231

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._
235+
185236
The `target` directive is used to restrict tests to run on certain
186237
platforms/systems. Currently, the target directive is ignored entirely and the
187238
tests are always run. Currently, the gfortran tests are only enabled on *nix on
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This file was generated by update-test-config.py
2+
#
3+
# Each line in this file corresponds to a single test. The format of each line
4+
# is:
5+
#
6+
# <kind>;<sources>;<xfail>;<options>;<enabled-on>;<disabled-on>
7+
#
8+
# where
9+
#
10+
# <kind> is one of 'preprocess', 'assemble', 'compile', 'link' or
11+
# 'run'.
12+
#
13+
# <sources> is a space separated list of sources files that comprise
14+
# the test. The first file is the "main" file. The rest
15+
# of the files must be specified in program compilation
16+
# order.
17+
#
18+
# <xfail> if present, must be 'xfail' which indicates that the test
19+
# is expected to trigger a compile-time or runtime error.
20+
#
21+
# <options> is a space separated list of options to be passed to the
22+
# compiler when building the test.
23+
#
24+
# <enabled-on> is a space-separated list of targets on which the test is
25+
# enabled. Each element of the list will be a regular
26+
# expression that is expected to match an LLVM target triple.
27+
# If no targets are provided, the test is enabled on all
28+
# targets.
29+
#
30+
# <disabled-on> is a space-separated list of targets on which the test is
31+
# disabled. Each element of the list will be a regular
32+
# expression that is expected to match an LLVM target triple.
33+
#
34+
compile;deferred_character_25.f90;;-Wno-analyzer-too-complex;;
35+
compile;malloc-example.f90;;-fcray-pointer;;
36+
compile;malloc.f90;;-fcray-pointer -O0;;
37+
compile;pr107210.f90;;-O1;;
38+
compile;pr108065.f90;;-fcheck=bounds -Wno-analyzer-malloc-leak;;
39+
compile;pr88304-2.f90;;;;
40+
compile;pr93405.f90;;;;
41+
compile;pr93777.f90;;-O0 -Wno-analyzer-possible-null-dereference -Wno-analyzer-null-dereference -Wno-analyzer-malloc-leak;;
42+
compile;pr93778.f90;;;;
43+
compile;pr93993.f90;;;;
44+
compile;pr96949.f90;;-Wno-analyzer-too-complex --param analyzer-max-svalue-depth=0;;
45+
compile;pr97668.f;;-std=legacy -Wno-analyzer-use-of-uninitialized-value -Wno-analyzer-too-complex;;
46+
compile;uninit-pr63311.f90;;-O0;;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This file was generated by update-test-config.py
2+
#
3+
# Each line in this file corresponds to a single test. The format of each line
4+
# is:
5+
#
6+
# <kind>;<sources>;<xfail>;<options>;<enabled-on>;<disabled-on>
7+
#
8+
# where
9+
#
10+
# <kind> is one of 'preprocess', 'assemble', 'compile', 'link' or
11+
# 'run'.
12+
#
13+
# <sources> is a space separated list of sources files that comprise
14+
# the test. The first file is the "main" file. The rest
15+
# of the files must be specified in program compilation
16+
# order.
17+
#
18+
# <xfail> if present, must be 'xfail' which indicates that the test
19+
# is expected to trigger a compile-time or runtime error.
20+
#
21+
# <options> is a space separated list of options to be passed to the
22+
# compiler when building the test.
23+
#
24+
# <enabled-on> is a space-separated list of targets on which the test is
25+
# enabled. Each element of the list will be a regular
26+
# expression that is expected to match an LLVM target triple.
27+
# If no targets are provided, the test is enabled on all
28+
# targets.
29+
#
30+
# <disabled-on> is a space-separated list of targets on which the test is
31+
# disabled. Each element of the list will be a regular
32+
# expression that is expected to match an LLVM target triple.
33+
#
34+
compile;associate_58.f90;;-O0;;
35+
compile;associate_59.f90;;-O0;;
36+
run;pointer_assign_16.f90;;;;
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# This file was generated by update-test-config.py
2+
#
3+
# Each line in this file corresponds to a single test. The format of each line
4+
# is:
5+
#
6+
# <kind>;<sources>;<xfail>;<options>;<enabled-on>;<disabled-on>
7+
#
8+
# where
9+
#
10+
# <kind> is one of 'preprocess', 'assemble', 'compile', 'link' or
11+
# 'run'.
12+
#
13+
# <sources> is a space separated list of sources files that comprise
14+
# the test. The first file is the "main" file. The rest
15+
# of the files must be specified in program compilation
16+
# order.
17+
#
18+
# <xfail> if present, must be 'xfail' which indicates that the test
19+
# is expected to trigger a compile-time or runtime error.
20+
#
21+
# <options> is a space separated list of options to be passed to the
22+
# compiler when building the test.
23+
#
24+
# <enabled-on> is a space-separated list of targets on which the test is
25+
# enabled. Each element of the list will be a regular
26+
# expression that is expected to match an LLVM target triple.
27+
# If no targets are provided, the test is enabled on all
28+
# targets.
29+
#
30+
# <disabled-on> is a space-separated list of targets on which the test is
31+
# disabled. Each element of the list will be a regular
32+
# expression that is expected to match an LLVM target triple.
33+
#
34+
compile;allocatable-optional-pointer.f90;;;;
35+
compile;assumed-type-dummy.f90;xfail;;;
36+
compile;c1255-1.f90;;;;
37+
compile;c1255-2.f90;xfail;;;
38+
compile;c1255a.f90;xfail;;;
39+
compile;c407a-1.f90;;;;
40+
compile;c407a-2.f90;xfail;-fcoarray=single;;
41+
compile;c407b-1.f90;;;;
42+
compile;c407b-2.f90;xfail;;;
43+
compile;c407c-1.f90;xfail;;;
44+
compile;c516.f90;xfail;;;
45+
compile;c524a.f90;xfail;-fcoarray=single;;
46+
compile;c535a-1.f90;;;;
47+
compile;c535a-2.f90;xfail;-fcoarray=single;;
48+
compile;c535b-1.f90;;-fcoarray=single;;
49+
compile;c535b-2.f90;xfail;-fcoarray=single;;
50+
compile;c535b-3.f90;xfail;-fcoarray=single;;
51+
compile;c535c-1.f90;xfail;;;
52+
compile;c535c-2.f90;xfail;;;
53+
compile;c535c-3.f90;xfail;;;
54+
compile;c535c-4.f90;xfail;;;
55+
compile;deferred-character-1.f90;xfail;;;
56+
compile;explicit-interface.f90;xfail;;;
57+
compile;fc-descriptor-pr108621.f90;;-fdump-tree-original;;
58+
compile;pr103287-1.f90;xfail;;;
59+
compile;pr103287-2.f90;xfail;;;
60+
compile;removed-restrictions-1.f90;;;;
61+
compile;removed-restrictions-2.f90;;;;
62+
compile;removed-restrictions-3.f90;;;;
63+
compile;removed-restrictions-4.f90;;;;
64+
compile;tkr.f90;xfail;;;
65+
run;allocatable-dummy.f90 allocatable-dummy-c.c dump-descriptors.c;;-g;;
66+
run;allocate-errors.f90 allocate-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
67+
run;allocate.f90 allocate-c.c dump-descriptors.c;;-g;;
68+
run;argument-association-assumed-rank-1.f90;;;;
69+
run;argument-association-assumed-rank-2.f90;;;;
70+
run;argument-association-assumed-rank-3.f90;;;;
71+
run;argument-association-assumed-rank-4.f90;;;;
72+
run;argument-association-assumed-rank-5.f90;;;;
73+
run;argument-association-assumed-rank-6.f90;;;;
74+
run;argument-association-assumed-rank-7.f90;;;;
75+
run;argument-association-assumed-rank-8.f90;;;;
76+
run;cf-descriptor-1.f90 cf-descriptor-1-c.c dump-descriptors.c;;;;
77+
run;cf-descriptor-2.f90 cf-descriptor-2-c.c dump-descriptors.c;;;;
78+
run;cf-descriptor-3.f90 cf-descriptor-3-c.c dump-descriptors.c;;-g;;
79+
run;cf-descriptor-4.f90 cf-descriptor-4-c.c dump-descriptors.c;;-g;;
80+
run;cf-descriptor-5.f90 cf-descriptor-5-c.c dump-descriptors.c;;-g;;
81+
run;cf-descriptor-6.f90 cf-descriptor-6-c.c dump-descriptors.c;;;;
82+
run;cf-descriptor-7.f90 cf-descriptor-7-c.c dump-descriptors.c;;;;
83+
run;cf-descriptor-8.f90 cf-descriptor-8-c.c dump-descriptors.c;;;;
84+
run;cf-out-descriptor-1.f90 cf-out-descriptor-1-c.c dump-descriptors.c;;;;
85+
run;cf-out-descriptor-2.f90 cf-out-descriptor-2-c.c dump-descriptors.c;;;;
86+
run;cf-out-descriptor-3.f90 cf-out-descriptor-3-c.c dump-descriptors.c;;-g;;
87+
run;cf-out-descriptor-4.f90 cf-out-descriptor-4-c.c dump-descriptors.c;;-g;;
88+
run;cf-out-descriptor-5.f90 cf-out-descriptor-5-c.c dump-descriptors.c;;-g;;
89+
run;cf-out-descriptor-6.f90 cf-out-descriptor-6-c.c dump-descriptors.c;;-g;;
90+
run;contiguous-1.f90 contiguous-1-c.c dump-descriptors.c;;-g;;
91+
run;contiguous-2.f90 contiguous-2-c.c dump-descriptors.c;;-g;;
92+
run;contiguous-3.f90 contiguous-3-c.c dump-descriptors.c;;-g;;
93+
run;deferred-character-2.f90;;;;
94+
run;establish-errors.f90 establish-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
95+
run;establish.f90 establish-c.c dump-descriptors.c;;-g;;
96+
run;fc-descriptor-1.f90 fc-descriptor-1-c.c dump-descriptors.c;;-g;;
97+
run;fc-descriptor-2.f90 fc-descriptor-2-c.c dump-descriptors.c;;-g;;
98+
run;fc-descriptor-3.f90 fc-descriptor-3-c.c dump-descriptors.c;;-g;;
99+
run;fc-descriptor-4.f90 fc-descriptor-4-c.c dump-descriptors.c;;-g;;
100+
run;fc-descriptor-5.f90 fc-descriptor-5-c.c dump-descriptors.c;;-g;;
101+
run;fc-descriptor-6.f90 fc-descriptor-6-c.c dump-descriptors.c;;-g;;
102+
run;fc-descriptor-7.f90 fc-descriptor-7-c.c dump-descriptors.c;;-g;;
103+
run;fc-descriptor-8.f90 fc-descriptor-8-c.c dump-descriptors.c;;;;
104+
run;fc-descriptor-9.f90 fc-descriptor-9-c.c dump-descriptors.c;;;;
105+
run;fc-out-descriptor-1.f90 fc-out-descriptor-1-c.c dump-descriptors.c;;-g;;
106+
run;fc-out-descriptor-2.f90 fc-out-descriptor-2-c.c dump-descriptors.c;;-g;;
107+
run;fc-out-descriptor-3.f90 fc-out-descriptor-3-c.c dump-descriptors.c;;-g;;
108+
run;fc-out-descriptor-4.f90 fc-out-descriptor-4-c.c dump-descriptors.c;;-g;;
109+
run;fc-out-descriptor-5.f90 fc-out-descriptor-5-c.c dump-descriptors.c;;;;
110+
run;fc-out-descriptor-6.f90 fc-out-descriptor-6-c.c dump-descriptors.c;;-g;;
111+
run;fc-out-descriptor-7.f90 fc-out-descriptor-7-c.c dump-descriptors.c;;-g;;
112+
run;ff-descriptor-1.f90;;;;
113+
run;ff-descriptor-2.f90;;;;
114+
run;ff-descriptor-3.f90;;;;
115+
run;ff-descriptor-4.f90;;;;
116+
run;ff-descriptor-5.f90;;;;
117+
run;ff-descriptor-6.f90;;;;
118+
run;ff-descriptor-7.f90;;;;
119+
run;note-5-3.f90;;;;
120+
run;note-5-4.f90 note-5-4-c.c;;;;
121+
run;optional.f90 optional-c.c dump-descriptors.c;;-g;;
122+
run;pr103390-1.f90;;-fdump-tree-original;;
123+
run;pr103390-2.f90;;-fdump-tree-original;;
124+
run;pr103390-3.f90;;-fdump-tree-original;;
125+
run;pr103390-4.f90;;-fdump-tree-original;;
126+
run;pr103390-5.f90;;-fdump-tree-original;;
127+
run;pr103390-6.f90;;-fdump-tree-original;;
128+
run;pr103390-7.f90;;-fdump-tree-original;;
129+
run;pr103390-8.f90;;-fdump-tree-original;;
130+
run;pr103390-9.f90;;-fdump-tree-original;;
131+
run;rank-class.f90;;;;
132+
run;rank.f90;;;;
133+
run;section-1.f90 section-1-c.c dump-descriptors.c;;-g;;
134+
run;section-1p.f90 section-1-c.c dump-descriptors.c;;-g;;
135+
run;section-2.f90 section-2-c.c dump-descriptors.c;;-g;;
136+
run;section-2p.f90 section-2-c.c dump-descriptors.c;;-g;;
137+
run;section-3.f90 section-3-c.c dump-descriptors.c;;-g;;
138+
run;section-3p.f90 section-3-c.c dump-descriptors.c;;-g;;
139+
run;section-4.f90 section-4-c.c dump-descriptors.c;;-g;;
140+
run;section-errors.f90 section-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
141+
run;select-errors.f90 select-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
142+
run;select.f90 select-c.c dump-descriptors.c;;;;
143+
run;setpointer-errors.f90 setpointer-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
144+
run;setpointer.f90 setpointer-c.c dump-descriptors.c;;;;
145+
run;shape-bindc.f90;;;;
146+
run;shape-poly.f90;;;;
147+
run;shape.f90;;;;
148+
run;size-bindc.f90;;;;
149+
run;size-poly.f90;;;;
150+
run;size.f90;;;;
151+
run;typecodes-array-basic.f90 typecodes-array-basic-c.c dump-descriptors.c;;-g;;
152+
run;typecodes-array-char.f90 typecodes-array-char-c.c dump-descriptors.c;;-g;;
153+
run;typecodes-array-float128.f90 typecodes-array-float128-c.c dump-descriptors.c;;-g;;
154+
run;typecodes-array-int128.f90 typecodes-array-int128-c.c dump-descriptors.c;;-g;;
155+
run;typecodes-array-longdouble.f90 typecodes-array-longdouble-c.c dump-descriptors.c;;-g;;
156+
run;typecodes-sanity.f90 typecodes-sanity-c.c;;-g;;
157+
run;typecodes-scalar-basic.f90 typecodes-scalar-basic-c.c dump-descriptors.c;;-g;;
158+
run;typecodes-scalar-float128.f90 typecodes-scalar-float128-c.c dump-descriptors.c;;-g;;
159+
run;typecodes-scalar-int128.f90 typecodes-scalar-int128-c.c dump-descriptors.c;;-g;;
160+
run;typecodes-scalar-longdouble.f90 typecodes-scalar-longdouble-c.c dump-descriptors.c;;-g;;
161+
run;ubound-bindc.f90;;;;
162+
run;ubound-poly.f90;;;;
163+
run;ubound.f90;;;;

0 commit comments

Comments
 (0)