1 # Copyright
(C
) 1997-2017 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-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
/slp
-*.\
[cS\
]]] \
99 $flags $DEFAULT_VECTCFLAGS
100 et
-dg
-runtest dg
-runtest
[lsort \
101 [glob
-nocomplain $srcdir
/$subdir
/bb
-slp
*.\
[cS\
]]] \
102 $flags $VECT_SLP_CFLAGS
105 #### Tests with special options
106 global SAVED_DEFAULT_VECTCFLAGS
107 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
108 set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
110 #
--param vect
-max-version
-for-alias
-checks
=0 tests
111 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
112 lappend DEFAULT_VECTCFLAGS
"--param" "vect-max-version-for-alias-checks=0"
113 et
-dg
-runtest dg
-runtest
[lsort \
114 [glob
-nocomplain $srcdir
/$subdir
/no
-vfa
-*.\
[cS\
]]] \
115 "" $DEFAULT_VECTCFLAGS
118 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
119 lappend DEFAULT_VECTCFLAGS
"-ffast-math"
120 et
-dg
-runtest dg
-runtest
[lsort \
121 [glob
-nocomplain $srcdir
/$subdir
/fast
-math
-\
[ipsv\
]*.\
[cS\
]]] \
122 "" $DEFAULT_VECTCFLAGS
124 #
-ffast
-math SLP tests
125 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
126 lappend VECT_SLP_CFLAGS
"-ffast-math"
127 et
-dg
-runtest dg
-runtest
[lsort \
128 [glob
-nocomplain $srcdir
/$subdir
/fast
-math
-bb
-slp
-*.\
[cS\
]]] \
131 #
-fno
-fast
-math tests
132 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
133 lappend DEFAULT_VECTCFLAGS
"-fno-fast-math"
134 et
-dg
-runtest dg
-runtest
[lsort \
135 [glob
-nocomplain $srcdir
/$subdir
/no
-fast
-math
-*.\
[cS\
]]] \
136 "" $DEFAULT_VECTCFLAGS
138 #
-fno
-math
-errno tests
139 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
140 lappend DEFAULT_VECTCFLAGS
"-fno-math-errno"
141 et
-dg
-runtest dg
-runtest
[lsort \
142 [glob
-nocomplain $srcdir
/$subdir
/no
-math
-errno
-*.\
[cS\
]]] \
143 "" $DEFAULT_VECTCFLAGS
146 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
147 lappend DEFAULT_VECTCFLAGS
"-fwrapv"
148 et
-dg
-runtest dg
-runtest
[lsort \
149 [glob
-nocomplain $srcdir
/$subdir
/wrapv
-*.\
[cS\
]]] \
150 "" $DEFAULT_VECTCFLAGS
153 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
154 lappend DEFAULT_VECTCFLAGS
"-ftrapv"
155 et
-dg
-runtest dg
-runtest
[lsort \
156 [glob
-nocomplain $srcdir
/$subdir
/trapv
-*.\
[cS\
]]] \
157 "" $DEFAULT_VECTCFLAGS
159 #
-fno
-tree
-dce tests
160 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
161 lappend DEFAULT_VECTCFLAGS
"-fno-tree-dce"
162 et
-dg
-runtest dg
-runtest
[lsort \
163 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-dce
-*.\
[cS\
]]] \
164 "" $DEFAULT_VECTCFLAGS
166 #
-fsection
-anchors tests
167 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
168 lappend DEFAULT_VECTCFLAGS
"-fsection-anchors"
169 et
-dg
-runtest dg
-runtest
[lsort \
170 [glob
-nocomplain $srcdir
/$subdir
/section
-anchors
-*.\
[cS\
]]] \
171 "" $DEFAULT_VECTCFLAGS
173 # alignment
-sensitive
-fsection
-anchors tests
174 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
175 lappend DEFAULT_VECTCFLAGS
"-fsection-anchors" \
176 "-fdump-ipa-increase_alignment-details"
177 et
-dg
-runtest dg
-runtest
[lsort \
178 [glob
-nocomplain $srcdir
/$subdir
/aligned
-section
-anchors
-*.\
[cS\
]]] \
179 "" $DEFAULT_VECTCFLAGS
181 #
-fno
-section
-anchors tests
182 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
183 lappend DEFAULT_VECTCFLAGS
"-fno-section-anchors"
184 et
-dg
-runtest dg
-runtest
[lsort \
185 [glob
-nocomplain $srcdir
/$subdir
/no
-section
-anchors
-*.\
[cS\
]]] \
186 "" $DEFAULT_VECTCFLAGS
188 #
-funswitch
-loops tests
189 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
190 lappend DEFAULT_VECTCFLAGS
"-funswitch-loops"
191 et
-dg
-runtest dg
-runtest
[lsort \
192 [glob
-nocomplain $srcdir
/$subdir
/unswitch
-loops
-*.\
[cS\
]]] \
193 "" $DEFAULT_VECTCFLAGS
195 #
-fno
-trapping
-math tests
196 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
197 lappend DEFAULT_VECTCFLAGS
"-fno-trapping-math"
198 et
-dg
-runtest dg
-runtest
[lsort \
199 [glob
-nocomplain $srcdir
/$subdir
/no
-trapping
-math
-*.\
[cS\
]]] \
200 "" $DEFAULT_VECTCFLAGS
202 #
-fno
-tree
-scev
-cprop
203 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
204 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
205 et
-dg
-runtest dg
-runtest
[lsort \
206 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-vect
-*.\
[cS\
]]] \
207 "" $DEFAULT_VECTCFLAGS
209 #
-fno
-tree
-scev
-cprop
210 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
211 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
212 et
-dg
-runtest dg
-runtest
[lsort \
213 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-pr
*.\
[cS\
]]] \
214 "" $DEFAULT_VECTCFLAGS
216 #
-fno
-tree
-scev
-cprop
217 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
218 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
219 et
-dg
-runtest dg
-runtest
[lsort \
220 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-outer
-*.\
[cS\
]]] \
221 "" $DEFAULT_VECTCFLAGS
223 #
-fno
-tree
-scev
-cprop
-fno
-tree
-reassoc
224 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
225 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop" "-fno-tree-reassoc"
226 et
-dg
-runtest dg
-runtest
[lsort \
227 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-noreassoc
-*.\
[cS\
]]] \
228 "" $DEFAULT_VECTCFLAGS
230 #
-fno
-tree
-scev
-cprop
231 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
232 lappend DEFAULT_VECTCFLAGS
"-fno-tree-scev-cprop"
233 et
-dg
-runtest dg
-runtest
[lsort \
234 [glob
-nocomplain $srcdir
/$subdir
/no
-scevccp
-slp
-*.\
[cS\
]]] \
235 "" $DEFAULT_VECTCFLAGS
237 #
-fno
-tree
-dominator
-opts
238 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
239 lappend DEFAULT_VECTCFLAGS
"-fno-tree-dominator-opts"
240 et
-dg
-runtest dg
-runtest
[lsort \
241 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-dom
-*.\
[cS\
]]] \
242 "" $DEFAULT_VECTCFLAGS
245 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
246 lappend DEFAULT_VECTCFLAGS
"-fno-tree-pre"
247 et
-dg
-runtest dg
-runtest
[lsort \
248 [glob
-nocomplain $srcdir
/$subdir
/no
-tree
-pre
-*.\
[cS\
]]] \
249 "" $DEFAULT_VECTCFLAGS
252 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
253 lappend DEFAULT_VECTCFLAGS
"-Os"
254 et
-dg
-runtest dg
-runtest
[lsort \
255 [glob
-nocomplain $srcdir
/$subdir
/Os
-vect
-*.\
[cS\
]]] \
256 "" $DEFAULT_VECTCFLAGS
258 # With
--param ggc
-min-expand
=0 --param ggc
-min-heapsize
=0
259 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
260 lappend DEFAULT_VECTCFLAGS
"--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
261 et
-dg
-runtest dg
-runtest
[lsort \
262 [glob
-nocomplain $srcdir
/$subdir
/ggc
-*.\
[cS\
]]] \
263 "" $DEFAULT_VECTCFLAGS
265 #
-ftree
-loop
-if-convert-stores
266 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
267 lappend DEFAULT_VECTCFLAGS
"-ftree-loop-if-convert-stores"
268 et
-dg
-runtest dg
-runtest
[lsort \
269 [glob
-nocomplain $srcdir
/$subdir
/if-cvt
-stores
-vect
-*.\
[cS\
]]] \
270 "" $DEFAULT_VECTCFLAGS
273 # Don
't allow IPA cloning, because it throws our counts out of whack.
274 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
275 lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
276 if [istarget "spu-*-*"] {
277 lappend DEFAULT_VECTCFLAGS "-funroll-loops"
280 et-dg-runtest dg-runtest [lsort \
281 [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \
282 "" $DEFAULT_VECTCFLAGS
285 et-dg-runtest dg-runtest [lsort \
286 [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \
290 et-dg-runtest dg-runtest [lsort \
291 [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \
295 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
296 lappend VECT_SLP_CFLAGS "-fno-tree-reassoc"
297 et-dg-runtest dg-runtest [lsort \
298 [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \
302 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
303 lappend DEFAULT_VECTCFLAGS "-fno-tree-fre"
304 et-dg-runtest dg-runtest [lsort \
305 [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \
306 "" $DEFAULT_VECTCFLAGS
308 # -fno-tree-fre -fno-tree-pre
309 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
310 lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre"
311 et-dg-runtest dg-runtest [lsort \
312 [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \
313 "" $DEFAULT_VECTCFLAGS
316 set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
317 lappend VECT_SLP_CFLAGS "-fno-tree-sra"
318 et-dg-runtest dg-runtest [lsort \
319 [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \
324 set dg-do-what-default ${save-dg-do-what-default}