1 # Copyright
(C
) 1997-2024 Free Software Foundation
, Inc.
3 # This
program is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
3 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with GCC
; see the file COPYING3.
If not see
15 #
<http
://www.gnu.org
/licenses
/>.
17 # GCC testsuite that uses the `dg.exp
' driver.
23 # Set up flags used for tests that don't specify options.
24 global DEFAULT_VECTCFLAGS
25 set DEFAULT_VECTCFLAGS
""
27 #
Set up a list of effective targets to run vector tests
for all supported
29 global EFFECTIVE_TARGETS
30 set EFFECTIVE_TARGETS
""
32 #
If the target
system supports vector instructions
, the default action
33 #
for a test is
'run', otherwise it
's 'compile'. Save current default.
34 # Executing vector instructions on a system without hardware vector support
35 # is also disabled by a call to check_vect, but disabling execution here is
37 global dg-do-what-default
38 set save-dg-do-what-default ${dg-do-what-default}
40 # Skip these tests for targets that do not support generating vector
41 # code. Set additional target-dependent vector flags, which can be
42 # overridden by using dg-options in individual tests.
43 if ![check_vect_support_and_set_flags] {
47 # These flags are used for all targets.
48 lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-tree-loop-distribute-patterns" "-fno-vect-cost-model" "-fno-common"
55 set VEC_FLAGS $DEFAULT_VECTCFLAGS
58 set O1_VECTCFLAGS $DEFAULT_VECTCFLAGS
59 lappend O1_VECTCFLAGS
"-O1"
60 lappend O1_VECTCFLAGS
"-fdump-tree-vect-details"
63 set O_VECTCFLAGS $DEFAULT_VECTCFLAGS
64 lappend O_VECTCFLAGS
"-O"
65 lappend O_VECTCFLAGS
"-fdump-tree-vect-details"
67 lappend DEFAULT_VECTCFLAGS
"-O2"
69 # Tests that should be run without generating dump
info
70 et
-dg
-runtest dg
-runtest
[lsort \
71 [glob
-nocomplain $srcdir
/$subdir
/nodump
-*.\
[cS\
]]] \
72 "" $DEFAULT_VECTCFLAGS
74 #
"-O -fdump-tree-veclower2"
75 lappend VEC_FLAGS
"-O" "-fdump-tree-veclower2"
76 et
-dg
-runtest dg
-runtest
[lsort
[glob
-nocomplain \
77 $srcdir
/$subdir
/vec
-scal
-*.\
[cS\
]]] \
80 set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
82 lappend DEFAULT_VECTCFLAGS
"-fdump-tree-vect-details"
83 lappend VECT_SLP_CFLAGS
"-fdump-tree-slp-details"
86 set VECT_ADDITIONAL_FLAGS
[list
""]
87 if { [check_effective_target_lto
] } {
88 lappend VECT_ADDITIONAL_FLAGS
"-flto -ffat-lto-objects"
90 foreach flags $VECT_ADDITIONAL_FLAGS
{
91 et
-dg
-runtest dg
-runtest
[lsort \
92 [glob
-nocomplain $srcdir
/$subdir
/pr
*.\
[cS\
]]] \
93 $flags $DEFAULT_VECTCFLAGS
94 et
-dg
-runtest dg
-runtest
[lsort \
95 [glob
-nocomplain $srcdir
/$subdir
/vect
-*.\
[cS\
]]] \
96 $flags $DEFAULT_VECTCFLAGS
97 et
-dg
-runtest dg
-runtest
[lsort \
98 [glob
-nocomplain $srcdir
/$subdir
/tsvc
/*.\
[cS\
]]] \
99 $flags $DEFAULT_VECTCFLAGS
100 et
-dg
-runtest dg
-runtest
[lsort \
101 [glob
-nocomplain $srcdir
/$subdir
/slp
-*.\
[cS\
]]] \
102 $flags $DEFAULT_VECTCFLAGS
103 et
-dg
-runtest dg
-runtest
[lsort \
104 [glob
-nocomplain $srcdir
/$subdir
/bb
-slp
*.\
[cS\
]]] \
105 $flags $VECT_SLP_CFLAGS
108 #### Tests with special options
109 global SAVED_DEFAULT_VECTCFLAGS
110 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
111 set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
113 #
--param vect
-max-version
-for-alias
-checks
=0 tests
114 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
115 lappend DEFAULT_VECTCFLAGS
"--param" "vect-max-version-for-alias-checks=0"
116 et
-dg
-runtest dg
-runtest
[lsort \
117 [glob
-nocomplain $srcdir
/$subdir
/no
-vfa
-*.\
[cS\
]]] \
118 "" $DEFAULT_VECTCFLAGS
121 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
122 lappend DEFAULT_VECTCFLAGS
"-ffast-math"
123 et
-dg
-runtest dg
-runtest
[lsort \
124 [glob
-nocomplain $srcdir
/$subdir
/fast
-math
-\
[ipsvc\
]*.\
[cS\
]]] \
125 "" $DEFAULT_VECTCFLAGS
127 #
-ffast
-math SLP tests
128 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
129 lappend VECT_SLP_CFLAGS
"-ffast-math"
130 et
-dg
-runtest dg
-runtest
[lsort \
131 [glob
-nocomplain $srcdir
/$subdir
/fast
-math
-bb
-slp
-*.\
[cS\
]]] \
134 #
-fno
-fast
-math tests
135 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
136 lappend DEFAULT_VECTCFLAGS
"-fno-fast-math"
137 et
-dg
-runtest dg
-runtest
[lsort \
138 [glob
-nocomplain $srcdir
/$subdir
/no
-fast
-math
-*.\
[cS\
]]] \
139 "" $DEFAULT_VECTCFLAGS
141 #
-fno
-math
-errno tests
142 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
143 lappend DEFAULT_VECTCFLAGS
"-fno-math-errno"
144 et
-dg
-runtest dg
-runtest
[lsort \
145 [glob
-nocomplain $srcdir
/$subdir
/no
-math
-errno
-*.\
[cS\
]]] \
146 "" $DEFAULT_VECTCFLAGS
149 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
150 lappend DEFAULT_VECTCFLAGS
"-fwrapv"
151 et
-dg
-runtest dg
-runtest
[lsort \
152 [glob
-nocomplain $srcdir
/$subdir
/wrapv
-*.\
[cS\
]]] \
153 "" $DEFAULT_VECTCFLAGS
156 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
157 lappend DEFAULT_VECTCFLAGS
"-ftrapv"
158 et
-dg
-runtest dg
-runtest
[lsort \
159 [glob
-nocomplain $srcdir
/$subdir
/trapv
-*.\
[cS\
]]] \
160 "" $DEFAULT_VECTCFLAGS
162 #
-fno
-tree
-dce tests
163 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
164 lappend DEFAULT_VECTCFLAGS
"-fno-tree-dce"
165 et
-dg
-runtest dg
-runtest
[lsort \
166 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-dce
-*.\
[cS\
]]] \
167 "" $DEFAULT_VECTCFLAGS
169 #
-fsection
-anchors tests
170 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
171 lappend DEFAULT_VECTCFLAGS
"-fsection-anchors"
172 et
-dg
-runtest dg
-runtest
[lsort \
173 [glob
-nocomplain $srcdir
/$subdir
/section
-anchors
-*.\
[cS\
]]] \
174 "" $DEFAULT_VECTCFLAGS
176 # alignment
-sensitive
-fsection
-anchors tests
177 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
178 lappend DEFAULT_VECTCFLAGS
"-fsection-anchors" \
179 "-fdump-ipa-increase_alignment-details"
180 et
-dg
-runtest dg
-runtest
[lsort \
181 [glob
-nocomplain $srcdir
/$subdir
/aligned
-section
-anchors
-*.\
[cS\
]]] \
182 "" $DEFAULT_VECTCFLAGS
184 #
-fno
-section
-anchors tests
185 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
186 lappend DEFAULT_VECTCFLAGS
"-fno-section-anchors"
187 et
-dg
-runtest dg
-runtest
[lsort \
188 [glob
-nocomplain $srcdir
/$subdir
/no
-section
-anchors
-*.\
[cS\
]]] \
189 "" $DEFAULT_VECTCFLAGS
191 #
-funswitch
-loops tests
192 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
193 lappend DEFAULT_VECTCFLAGS
"-funswitch-loops"
194 et
-dg
-runtest dg
-runtest
[lsort \
195 [glob
-nocomplain $srcdir
/$subdir
/unswitch
-loops
-*.\
[cS\
]]] \
196 "" $DEFAULT_VECTCFLAGS
198 #
-fno
-trapping
-math tests
199 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
200 lappend DEFAULT_VECTCFLAGS
"-fno-trapping-math"
201 et
-dg
-runtest dg
-runtest
[lsort \
202 [glob
-nocomplain $srcdir
/$subdir
/no
-trapping
-math
-*.\
[cS\
]]] \
203 "" $DEFAULT_VECTCFLAGS
205 #
-fno
-tree
-scev
-cprop
206 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
207 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
208 et
-dg
-runtest dg
-runtest
[lsort \
209 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-vect
-*.\
[cS\
]]] \
210 "" $DEFAULT_VECTCFLAGS
212 #
-fno
-tree
-scev
-cprop
213 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
214 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
215 et
-dg
-runtest dg
-runtest
[lsort \
216 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-pr
*.\
[cS\
]]] \
217 "" $DEFAULT_VECTCFLAGS
219 #
-fno
-tree
-scev
-cprop
220 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
221 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
222 et
-dg
-runtest dg
-runtest
[lsort \
223 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-outer
-*.\
[cS\
]]] \
224 "" $DEFAULT_VECTCFLAGS
226 #
-fno
-tree
-scev
-cprop
-fno
-tree
-reassoc
227 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
228 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop" "-fno-tree-reassoc"
229 et
-dg
-runtest dg
-runtest
[lsort \
230 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-noreassoc
-*.\
[cS\
]]] \
231 "" $DEFAULT_VECTCFLAGS
233 #
-fno
-tree
-scev
-cprop
234 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
235 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
236 et
-dg
-runtest dg
-runtest
[lsort \
237 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-slp
-*.\
[cS\
]]] \
238 "" $DEFAULT_VECTCFLAGS
240 #
-fno
-tree
-dominator
-opts
241 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
242 lappend DEFAULT_VECTCFLAGS
"-fno-tree-dominator-opts"
243 et
-dg
-runtest dg
-runtest
[lsort \
244 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-dom
-*.\
[cS\
]]] \
245 "" $DEFAULT_VECTCFLAGS
248 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
249 lappend DEFAULT_VECTCFLAGS
"-fno-tree-pre"
250 et
-dg
-runtest dg
-runtest
[lsort \
251 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-pre
-*.\
[cS\
]]] \
252 "" $DEFAULT_VECTCFLAGS
255 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
256 lappend DEFAULT_VECTCFLAGS
"-Os"
257 et
-dg
-runtest dg
-runtest
[lsort \
258 [glob
-nocomplain $srcdir
/$subdir
/Os
-vect
-*.\
[cS\
]]] \
259 "" $DEFAULT_VECTCFLAGS
261 # With
--param ggc
-min-expand
=0 --param ggc
-min-heapsize
=0
262 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
263 lappend DEFAULT_VECTCFLAGS
"--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
264 et
-dg
-runtest dg
-runtest
[lsort \
265 [glob
-nocomplain $srcdir
/$subdir
/ggc
-*.\
[cS\
]]] \
266 "" $DEFAULT_VECTCFLAGS
269 # Don
't allow IPA cloning, because it throws our counts out of whack.
270 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
271 lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
273 et-dg-runtest dg-runtest [lsort \
274 [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \
275 "" $DEFAULT_VECTCFLAGS
278 et-dg-runtest dg-runtest [lsort \
279 [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \
283 et-dg-runtest dg-runtest [lsort \
284 [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \
288 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
289 lappend VECT_SLP_CFLAGS "-fno-tree-reassoc"
290 et-dg-runtest dg-runtest [lsort \
291 [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \
295 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
296 lappend DEFAULT_VECTCFLAGS "-fno-tree-fre"
297 et-dg-runtest dg-runtest [lsort \
298 [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \
299 "" $DEFAULT_VECTCFLAGS
301 # -fno-tree-fre -fno-tree-pre
302 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
303 lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre"
304 et-dg-runtest dg-runtest [lsort \
305 [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \
306 "" $DEFAULT_VECTCFLAGS
309 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
310 lappend VECT_SLP_CFLAGS "-fno-tree-sra"
311 et-dg-runtest dg-runtest [lsort \
312 [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \
317 set dg-do-what-default ${save-dg-do-what-default}