Skip to content

Commit c842c7d

Browse files
committed
[Fortran/gfortran] Better handling of unsupported gfortran options
A number of tests use gfortran-specific options which are either not supported in flang, or for which a suitable equivalent has not yet been enabled. These options used to be filtered out in CMakeLists.txt when configuring the test suite. This has been moved to the test configuration script to allow for more flexibility (since cmake is a terrible language in which to do anything even remotely sophisticated). Doing this has allowed us to perform wildcard matches for options that expose gfortran's internal structure which is obviously not relevant for flang. This means that in the future, we do not have to constantly update the filter with these options. We can now also distinguish between the option name and its value, so we can filter simply based on the option spelling. The test configuration files have been regenerated after this change. Some tests fail with this updated configuration and they have been disabled.
1 parent b4f4c62 commit c842c7d

File tree

20 files changed

+2939
-3068
lines changed

20 files changed

+2939
-3068
lines changed

Fortran/gfortran/CMakeLists.txt

Lines changed: 1 addition & 419 deletions
Large diffs are not rendered by default.

Fortran/gfortran/regression/DisabledFiles.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
10071007
unsigned_38.f90
10081008
unsigned_41.f90
10091009

1010+
# This test requires the -fmax-array-constructor option which is not supported
1011+
# in flang (yet?)
1012+
spread_size_limit_2.f90
1013+
10101014
# This test seems to have been commented out entirely, and therefore
10111015
# compilation will succeed. However, there are still DejaGNU annotations in
10121016
# it, and one of them is xfail, so our framework registers this test as xfail.
@@ -1114,6 +1118,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
11141118
c_loc_test_21.f90
11151119
c_loc_tests_10.f03
11161120
c_loc_tests_4.f03
1121+
c_sizeof_2.f90
11171122
char_length_1.f90
11181123
coarray_5.f90
11191124
common_20.f90
@@ -1127,6 +1132,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
11271132
iall_iany_iparity_2.f90
11281133
intrinsic_std_5.f03
11291134
io_constraints_12.f90
1135+
line_length_13.f90
11301136
module_procedure_double_colon_3.f90
11311137
norm2_4.f90
11321138
parity_3.f90
@@ -1160,6 +1166,9 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
11601166
# Requires behaviour specific to -std=f2008 and fails with -std=f2018.
11611167
finalize_38a.f90
11621168

1169+
# -std=f2023 test to check for restrictions on arguments to SYSTEM_CLOCK
1170+
system_clock_4.f90
1171+
11631172
# Tests that use -std=... to enable checks that no longer apply in modern Fortran.
11641173
# Module variable with derived type default initialization requires explicit SAVE
11651174
default_initialization_1.f90
@@ -1529,6 +1538,17 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
15291538
# expected to succeed.
15301539
internal_dummy_1.f90
15311540

1541+
# This has a #warning directive alongside -Werror, but no dg-error annotation.
1542+
# As a result, the test does not get marked as 'xfail' but does raise a
1543+
# compile-time error.
1544+
# TODO: This test should be overridden permanently.
1545+
diagnostic-format-json-3.F90
1546+
1547+
# This has a #warning directive alongside -Werror and -Wno-error=cpp. Since
1548+
# -Wno-error is not supported, but -Werror is, the test raises a compile-time
1549+
# error when it should not.
1550+
warning-directive-3.F90
1551+
15321552
# This test has a #illegal preprocessor directive. I think this is expected to
15331553
# raise a warning in gfortran, but flang raises an error and fails to compile
15341554
# instead. This may be a policy difference between flang and gfortran but

Fortran/gfortran/regression/analyzer/tests.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333
# disabled. Each element of the list will be a regular
3434
# expression that is expected to match an LLVM target triple.
3535
#
36-
compile;deferred_character_25.f90;;-Wno-analyzer-too-complex;;
37-
compile;malloc-example.f90;;-fcray-pointer;;
38-
compile;malloc.f90;;-fcray-pointer -O0;;
36+
compile;deferred_character_25.f90;;;;
37+
compile;malloc-example.f90;;;;
38+
compile;malloc.f90;;-O0;;
3939
compile;pr107210.f90;;-O1;;
40-
compile;pr108065.f90;;-fcheck=bounds -Wno-analyzer-malloc-leak;;
40+
compile;pr108065.f90;;;;
4141
compile;pr88304-2.f90;;;;
4242
compile;pr93405.f90;;;;
43-
compile;pr93777.f90;;-O0 -Wno-analyzer-possible-null-dereference -Wno-analyzer-null-dereference -Wno-analyzer-malloc-leak;;
43+
compile;pr93777.f90;;-O0;;
4444
compile;pr93778.f90;;;;
4545
compile;pr93993.f90;;;;
46-
compile;pr96949.f90;;-Wno-analyzer-too-complex --param analyzer-max-svalue-depth=0;;powerpc-.+-aix
47-
compile;pr97668.f;;-std=legacy -Wno-analyzer-use-of-uninitialized-value -Wno-analyzer-too-complex;;
46+
compile;pr96949.f90;;;;powerpc-.+-aix
47+
compile;pr97668.f;;;;
4848
compile;uninit-pr63311.f90;;-O0;;

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ compile;c1255-1.f90;;;;
3939
compile;c1255-2.f90;xfail;;;
4040
compile;c1255a.f90;xfail;;;
4141
compile;c407a-1.f90;;;;
42-
compile;c407a-2.f90;xfail;-fcoarray=single;;
42+
compile;c407a-2.f90;xfail;;;
4343
compile;c407b-1.f90;;;;
4444
compile;c407b-2.f90;xfail;;;
4545
compile;c407c-1.f90;xfail;;;
4646
compile;c516.f90;xfail;;;
47-
compile;c524a.f90;xfail;-fcoarray=single;;
47+
compile;c524a.f90;xfail;;;
4848
compile;c535a-1.f90;;;;
49-
compile;c535a-2.f90;xfail;-fcoarray=single;;
50-
compile;c535b-1.f90;;-fcoarray=single;;
51-
compile;c535b-2.f90;xfail;-fcoarray=single;;
52-
compile;c535b-3.f90;xfail;-fcoarray=single;;
49+
compile;c535a-2.f90;xfail;;;
50+
compile;c535b-1.f90;;;;
51+
compile;c535b-2.f90;xfail;;;
52+
compile;c535b-3.f90;xfail;;;
5353
compile;c535c-1.f90;xfail;;;
5454
compile;c535c-2.f90;xfail;;;
5555
compile;c535c-3.f90;xfail;;;
5656
compile;c535c-4.f90;xfail;;;
5757
compile;deferred-character-1.f90;xfail;;;
5858
compile;explicit-interface.f90;xfail;;;
59-
compile;fc-descriptor-pr108621.f90;;-fdump-tree-original;;
59+
compile;fc-descriptor-pr108621.f90;;;;
6060
compile;pr103287-1.f90;xfail;;;
6161
compile;pr103287-2.f90;xfail;;;
6262
compile;removed-restrictions-1.f90;;;;
@@ -65,7 +65,7 @@ compile;removed-restrictions-3.f90;;;;
6565
compile;removed-restrictions-4.f90;;;;
6666
compile;tkr.f90;xfail;;;
6767
run;allocatable-dummy.f90 allocatable-dummy-c.c dump-descriptors.c;;-g;;
68-
run;allocate-errors.f90 allocate-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
68+
run;allocate-errors.f90 allocate-errors-c.c dump-descriptors.c;;;;
6969
run;allocate.f90 allocate-c.c dump-descriptors.c;;-g;;
7070
run;argument-association-assumed-rank-1.f90;;;;
7171
run;argument-association-assumed-rank-2.f90;;;;
@@ -93,7 +93,7 @@ run;contiguous-1.f90 contiguous-1-c.c dump-descriptors.c;;-g;;
9393
run;contiguous-2.f90 contiguous-2-c.c dump-descriptors.c;;-g;;
9494
run;contiguous-3.f90 contiguous-3-c.c dump-descriptors.c;;-g;;
9595
run;deferred-character-2.f90;;;;
96-
run;establish-errors.f90 establish-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
96+
run;establish-errors.f90 establish-errors-c.c dump-descriptors.c;;;;
9797
run;establish.f90 establish-c.c dump-descriptors.c;;-g;;
9898
run;fc-descriptor-1.f90 fc-descriptor-1-c.c dump-descriptors.c;;-g;;
9999
run;fc-descriptor-2.f90 fc-descriptor-2-c.c dump-descriptors.c;;-g;;
@@ -121,15 +121,15 @@ run;ff-descriptor-7.f90;;;;
121121
run;note-5-3.f90;;;;
122122
run;note-5-4.f90 note-5-4-c.c;;;;
123123
run;optional.f90 optional-c.c dump-descriptors.c;;-g;;
124-
run;pr103390-1.f90;;-fdump-tree-original;;
125-
run;pr103390-2.f90;;-fdump-tree-original;;
126-
run;pr103390-3.f90;;-fdump-tree-original;;
127-
run;pr103390-4.f90;;-fdump-tree-original;;
128-
run;pr103390-5.f90;;-fdump-tree-original;;
129-
run;pr103390-6.f90;;-fdump-tree-original;;
130-
run;pr103390-7.f90;;-fdump-tree-original;;
131-
run;pr103390-8.f90;;-fdump-tree-original;;
132-
run;pr103390-9.f90;;-fdump-tree-original;;
124+
run;pr103390-1.f90;;;;
125+
run;pr103390-2.f90;;;;
126+
run;pr103390-3.f90;;;;
127+
run;pr103390-4.f90;;;;
128+
run;pr103390-5.f90;;;;
129+
run;pr103390-6.f90;;;;
130+
run;pr103390-7.f90;;;;
131+
run;pr103390-8.f90;;;;
132+
run;pr103390-9.f90;;;;
133133
run;rank-class.f90;;;;
134134
run;rank.f90;;;;
135135
run;section-1.f90 section-1-c.c dump-descriptors.c;;-g;;
@@ -139,10 +139,10 @@ run;section-2p.f90 section-2-c.c dump-descriptors.c;;-g;;
139139
run;section-3.f90 section-3-c.c dump-descriptors.c;;-g;;
140140
run;section-3p.f90 section-3-c.c dump-descriptors.c;;-g;;
141141
run;section-4.f90 section-4-c.c dump-descriptors.c;;-g;;
142-
run;section-errors.f90 section-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
143-
run;select-errors.f90 select-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
142+
run;section-errors.f90 section-errors-c.c dump-descriptors.c;;;;
143+
run;select-errors.f90 select-errors-c.c dump-descriptors.c;;;;
144144
run;select.f90 select-c.c dump-descriptors.c;;;;
145-
run;setpointer-errors.f90 setpointer-errors-c.c dump-descriptors.c;;-Wno-error -fcheck=all;;
145+
run;setpointer-errors.f90 setpointer-errors-c.c dump-descriptors.c;;;;
146146
run;setpointer.f90 setpointer-c.c dump-descriptors.c;;;;
147147
run;shape-bindc.f90;;;;
148148
run;shape-poly.f90;;;;

Fortran/gfortran/regression/coarray/tests.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
compile;alloc_comp_2.f90;;;;
3737
compile;alloc_comp_3.f90;;;;
3838
compile;array_temporary-1.f90;;;;
39-
compile;array_temporary.f90;;-Warray-temporaries;;
39+
compile;array_temporary.f90;;;;
4040
compile;class_1.f90;;;;
4141
compile;coindexed_2.f90;xfail;;;
42-
compile;coindexed_4.f08;xfail;-std=f2008;;
42+
compile;coindexed_4.f08;xfail;;;
4343
compile;data_1.f90;xfail;;;
4444
compile;dummy_2.f90;;;;
4545
compile;fail_image_1.f08;xfail;;;
@@ -62,7 +62,7 @@ run;allocate_errgmsg.f90;;;;
6262
run;associate_1.f90;;;;
6363
run;atomic_1.f90;;;;
6464
run;atomic_2.f90;;;;
65-
run;coarray_allocated.f90;;-fdump-tree-original;;
65+
run;coarray_allocated.f90;;;;
6666
run;codimension.f90;;;;
6767
run;codimension_3.f90;;;;
6868
run;coindexed_1.f90;;;;
@@ -123,6 +123,6 @@ run;submodule_1.f90 add_sources/submodule_1_sub.f90;;;;
123123
run;subobject_1.f90;;;;
124124
run;substring_1.f90;;;;
125125
run;sync_1.f90;;;;
126-
run;sync_3.f90;xfail;-fcheck=all;;
126+
run;sync_3.f90;xfail;;;
127127
run;this_image_1.f90;;;;
128128
run;this_image_2.f90;;;;

Fortran/gfortran/regression/debug/tests.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
# disabled. Each element of the list will be a regular
3434
# expression that is expected to match an LLVM target triple.
3535
#
36-
compile;pr35154-dwarf2.f;;-dA -gno-strict-dwarf;;
37-
compile;pr37738.f;;-dA -gno-strict-dwarf;;
36+
compile;pr35154-dwarf2.f;;;;
37+
compile;pr37738.f;;;;
3838
compile;pr43166.f;;-O;;
39-
compile;pr46756.f;;-O -fcompare-debug;;
39+
compile;pr46756.f;;-O;;
4040
compile;trivial.f;;;;

Fortran/gfortran/regression/f202y/tests.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
# disabled. Each element of the list will be a regular
3434
# expression that is expected to match an LLVM target triple.
3535
#
36-
compile;generic_assumed_rank_2.f90;xfail;-std=f2023 -Wsurprising;;
37-
run;generic_assumed_rank_1.f90;;-fcheck=bounds;;
38-
run;generic_assumed_rank_3.f90;;-std=f202y -Wsurprising;;
36+
compile;generic_assumed_rank_2.f90;xfail;;;
37+
run;generic_assumed_rank_1.f90;;;;
38+
run;generic_assumed_rank_3.f90;;;;

Fortran/gfortran/regression/g77/tests.cmake

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
# expression that is expected to match an LLVM target triple.
3535
#
3636
compile;12002.f;;;;
37-
compile;12632.f;;-fbounds-check;;
37+
compile;12632.f;;;;
3838
compile;13060.f;;;;
39-
compile;19981216-0.f;;-std=legacy;;
39+
compile;19981216-0.f;;;;
4040
compile;19990218-0.f;xfail;;;
4141
compile;19990218-1.f;xfail;;;
4242
compile;19990305-0.f;;;;
4343
compile;19990419-0.f;;;;
4444
compile;19990502-0.f;;;;
4545
compile;19990502-1.f;;;;
46-
compile;19990525-0.f;;-std=legacy;;
46+
compile;19990525-0.f;;;;
4747
compile;19990826-1.f;;;;
48-
compile;19990826-3.f;;-std=legacy;;
48+
compile;19990826-3.f;;;;
4949
compile;19990905-0.f;;;;
5050
compile;19990905-1.f;xfail;;;
5151
compile;19990905-2.f;;;;
@@ -56,27 +56,27 @@ compile;20000518.f;;;;
5656
compile;20000601-1.f;;;;
5757
compile;20000601-2.f;;;;
5858
compile;20000629-1.f;;;;
59-
compile;20000630-2.f;;-std=legacy;;
59+
compile;20000630-2.f;;;;
6060
compile;20010115.f;;;;
6161
compile;20010321-1.f;;;;
6262
compile;20010426.f;;;;
63-
compile;20010519-1.f;;-std=legacy;;
64-
compile;20020307-1.f;;-std=legacy;;
63+
compile;20010519-1.f;;;;
64+
compile;20020307-1.f;;;;
6565
compile;20030326-1.f;xfail;-pedantic;;
6666
compile;8485.f;;;;
6767
compile;9263.f;xfail;;;
6868
compile;960317-1.f;;;;
69-
compile;970125-0.f;xfail;-w;;
69+
compile;970125-0.f;xfail;;;
7070
compile;970625-2.f;xfail;;;
7171
compile;970915-0.f;;;;
7272
compile;980310-1.f;;;;
7373
compile;980310-2.f;;;;
74-
compile;980310-3.f;;-std=legacy;;
74+
compile;980310-3.f;;;;
7575
compile;980310-4.f;;;;
7676
compile;980310-6.f;;;;
7777
compile;980310-7.f;;;;
7878
compile;980310-8.f;;;;
79-
compile;980419-2.f;;-std=legacy;;
79+
compile;980419-2.f;;;;
8080
compile;980424-0.f;;;;
8181
compile;980427-0.f;;;;
8282
compile;980519-2.f;;;;
@@ -86,7 +86,7 @@ compile;980729-0.f;;;;
8686
compile;981117-1.f;;;;
8787
compile;990115-1.f;;;;
8888
compile;alpha1.f;;;;
89-
compile;check0.f;xfail;-std=legacy;;
89+
compile;check0.f;xfail;;;
9090
compile;cpp.F;;;;
9191
compile;cpp2.F;;;;
9292
compile;cpp6.f;;;;
@@ -101,60 +101,60 @@ compile;ffree-form-2.f;;-ffree-form;;
101101
compile;ffree-form-3.f;;-ffree-form;;
102102
compile;fno-underscoring.f;;-fno-underscoring;;
103103
compile;funderscoring.f;;-funderscoring;;
104-
compile;pr105203.f;;-O2 -fcompare-debug -ftracer -w;;
104+
compile;pr105203.f;;-O2;;
105105
compile;pr9258.f;;;;
106106
compile;toon_1.f;;;;
107107
compile;xformat.f;;;;
108108
run;13037.f;;;;
109-
run;1832.f;;-std=legacy;;
109+
run;1832.f;;;;
110110
run;19981119-0.f;;;;
111111
run;19990313-0.f;;;;
112112
run;19990313-1.f;;;;
113113
run;19990313-2.f;;;;
114114
run;19990313-3.f;;;;
115115
run;19990419-1.f;;;;
116116
run;19990826-0.f;;;;
117-
run;19990826-2.f;;-std=legacy;;
117+
run;19990826-2.f;;;;
118118
run;20000503-1.f;;;;
119119
run;20001111.f;;;;
120-
run;20010116.f;;-std=legacy;;
120+
run;20010116.f;;;;
121121
run;20010216-1.f;;-ffast-math -march=pentiumpro;;
122122
run;20010426-1.f;;;;
123123
run;20010430.f;;;;
124124
run;20010610.f;;;;
125125
run;6177.f;;;;
126-
run;7388.f;;-fbounds-check;;
126+
run;7388.f;;;;
127127
run;947.f;;;;
128128
run;970816-3.f;;;;
129129
run;971102-1.f;;;;
130-
run;980520-1.f;;-std=legacy;;
130+
run;980520-1.f;;;;
131131
run;980628-0.f;;;;
132132
run;980628-1.f;;;;
133-
run;980628-10.f;;-std=gnu;;
134-
run;980628-2.f;;-std=gnu;;
135-
run;980628-3.f;;-std=gnu;;
133+
run;980628-10.f;;;;
134+
run;980628-2.f;;;;
135+
run;980628-3.f;;;;
136136
run;980628-7.f;;;;
137137
run;980628-8.f;;;;
138-
run;980628-9.f;;-std=gnu;;
138+
run;980628-9.f;;;;
139139
run;980701-0.f;;;;
140140
run;980701-1.f;;;;
141141
run;cabs.f;;;;
142142
run;claus.f;;;;
143143
run;complex_1.f;;;;
144-
run;cpp3.F;;-std=legacy;;
144+
run;cpp3.F;;;;
145145
run;cpp4.F;;;;
146146
run;cpp5.F;;;;
147147
run;dcomplex.f;;;;
148-
run;dnrm2.f;;-fno-bounds-check;;
148+
run;dnrm2.f;;;;
149149
run;erfc.f;;;;
150150
run;f77-edit-apostrophe-out.f;;;;
151151
run;f77-edit-colon-out.f;;;;
152152
run;f77-edit-h-out.f;;;;
153-
run;f77-edit-i-in.f;;-std=legacy;;
153+
run;f77-edit-i-in.f;;;;
154154
run;f77-edit-i-out.f;;;;
155155
run;f77-edit-s-out.f;;;;
156156
run;f77-edit-slash-out.f;;;;
157-
run;f77-edit-t-in.f;;-std=legacy;;
157+
run;f77-edit-t-in.f;;;;
158158
run;f77-edit-t-out.f;;;;
159159
run;f77-edit-x-out.f;;;;
160160
run;f90-intrinsic-bit.f;;;;
@@ -166,5 +166,5 @@ run;intrinsic-unix-erf.f;;;;
166166
run;labug1.f;;;;
167167
run;large_vec.f;;;;
168168
run;le.f;;;;
169-
run;short.f;;-std=legacy;;
170-
run;strlen0.f;;-fbounds-check;;
169+
run;short.f;;;;
170+
run;strlen0.f;;;;

Fortran/gfortran/regression/goacc-gomp/tests.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
# disabled. Each element of the list will be a regular
3434
# expression that is expected to match an LLVM target triple.
3535
#
36-
compile;atomic.f90;;-fdump-tree-original;;
36+
compile;atomic.f90;;;;
3737
compile;depobj.f90;xfail;;;
38-
compile;fixed-1.f;;-fdump-tree-original -Wunused-variable;;
39-
compile;free-1.f90;;-fdump-tree-original -Wunused-variable;;
40-
compile;mixed-1.f;xfail;-fdump-tree-original;;
41-
compile;pr102330-1.f90;;-fopt-info-omp-note --param=openacc-privatization=noisy;;
38+
compile;fixed-1.f;;;;
39+
compile;free-1.f90;;;;
40+
compile;mixed-1.f;xfail;;;
41+
compile;pr102330-1.f90;;;;

0 commit comments

Comments
 (0)