]>
Commit | Line | Data |
---|---|---|
23a5b65a | 1 | # Copyright (C) 1997-2014 Free Software Foundation, Inc. |
79fe1b3b DN |
2 | |
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 | |
cd976c16 | 5 | # the Free Software Foundation; either version 3 of the License, or |
79fe1b3b DN |
6 | # (at your option) any later version. |
7 | # | |
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. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
cd976c16 NC |
14 | # along with GCC; see the file COPYING3. If not see |
15 | # <http://www.gnu.org/licenses/>. | |
79fe1b3b DN |
16 | |
17 | # GCC testsuite that uses the `dg.exp' driver. | |
18 | ||
19 | # Load support procs. | |
20 | load_lib gcc-dg.exp | |
21 | ||
07d05ffd | 22 | # Set up flags used for tests that don't specify options. |
9a31f6a3 | 23 | global DEFAULT_VECTCFLAGS |
07d05ffd JJ |
24 | set DEFAULT_VECTCFLAGS "" |
25 | ||
07d05ffd JJ |
26 | # If the target system supports vector instructions, the default action |
27 | # for a test is 'run', otherwise it's 'compile'. Save current default. | |
28 | # Executing vector instructions on a system without hardware vector support | |
29 | # is also disabled by a call to check_vect, but disabling execution here is | |
30 | # more efficient. | |
31 | global dg-do-what-default | |
32 | set save-dg-do-what-default ${dg-do-what-default} | |
33 | ||
34 | # Skip these tests for targets that do not support generating vector | |
35 | # code. Set additional target-dependent vector flags, which can be | |
36 | # overridden by using dg-options in individual tests. | |
9a31f6a3 | 37 | if ![check_vect_support_and_set_flags] { |
07d05ffd | 38 | return |
79fe1b3b DN |
39 | } |
40 | ||
d92826be | 41 | # These flags are used for all targets. |
1bb940da | 42 | lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-common" |
d92826be | 43 | |
79fe1b3b DN |
44 | # Initialize `dg'. |
45 | dg-init | |
46 | ||
ed378230 UB |
47 | global VEC_FLAGS |
48 | set VEC_FLAGS $DEFAULT_VECTCFLAGS | |
49 | ||
174f8765 IR |
50 | global O1_VECTCFLAGS |
51 | set O1_VECTCFLAGS $DEFAULT_VECTCFLAGS | |
52 | lappend O1_VECTCFLAGS "-O1" | |
53 | lappend O1_VECTCFLAGS "-fdump-tree-vect-details" | |
54 | ||
75264e61 IR |
55 | global O_VECTCFLAGS |
56 | set O_VECTCFLAGS $DEFAULT_VECTCFLAGS | |
57 | lappend O_VECTCFLAGS "-O" | |
58 | lappend O_VECTCFLAGS "-fdump-tree-vect-details" | |
59 | ||
174f8765 IR |
60 | lappend DEFAULT_VECTCFLAGS "-O2" |
61 | ||
b940ce0e DN |
62 | # Tests that should be run without generating dump info |
63 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \ | |
64 | "" $DEFAULT_VECTCFLAGS | |
65 | ||
3f7739ad UB |
66 | # "-O -fdump-tree-veclower2" |
67 | lappend VEC_FLAGS "-O" "-fdump-tree-veclower2" | |
d92826be IR |
68 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vec-scal-*.\[cS\]]] \ |
69 | "" $VEC_FLAGS | |
70 | ||
a70d6342 | 71 | set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS |
45a1ba93 UB |
72 | |
73 | lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details" | |
a70d6342 | 74 | lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" |
b940ce0e | 75 | |
79fe1b3b | 76 | # Main loop. |
5a2e5608 RS |
77 | set VECT_ADDITIONAL_FLAGS [list ""] |
78 | if { [check_effective_target_lto] } { | |
79a8482c | 79 | lappend VECT_ADDITIONAL_FLAGS "-flto -ffat-lto-objects" |
5a2e5608 RS |
80 | } |
81 | foreach flags $VECT_ADDITIONAL_FLAGS { | |
82 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \ | |
83 | $flags $DEFAULT_VECTCFLAGS | |
84 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \ | |
85 | $flags $DEFAULT_VECTCFLAGS | |
86 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ | |
87 | $flags $DEFAULT_VECTCFLAGS | |
88 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ | |
89 | $flags $VECT_SLP_CFLAGS | |
90 | } | |
a6b46ba2 DN |
91 | |
92 | #### Tests with special options | |
93 | global SAVED_DEFAULT_VECTCFLAGS | |
94 | set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS | |
a70d6342 | 95 | set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS |
a6b46ba2 | 96 | |
bc1edb77 VK |
97 | # --param vect-max-version-for-alias-checks=0 tests |
98 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
99 | lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0" | |
100 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[cS\]]] \ | |
101 | "" $DEFAULT_VECTCFLAGS | |
102 | ||
a6b46ba2 DN |
103 | # -ffast-math tests |
104 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
105 | lappend DEFAULT_VECTCFLAGS "-ffast-math" | |
190c2236 | 106 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-\[ipsv\]*.\[cS\]]] \ |
a6b46ba2 DN |
107 | "" $DEFAULT_VECTCFLAGS |
108 | ||
190c2236 JJ |
109 | # -ffast-math SLP tests |
110 | set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS | |
111 | lappend VECT_SLP_CFLAGS "-ffast-math" | |
112 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \ | |
113 | "" $VECT_SLP_CFLAGS | |
114 | ||
456e1323 IR |
115 | # -fno-fast-math tests |
116 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
117 | lappend DEFAULT_VECTCFLAGS "-fno-fast-math" | |
118 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]] \ | |
119 | "" $DEFAULT_VECTCFLAGS | |
120 | ||
db3cf6bd RG |
121 | # -fno-math-errno tests |
122 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
123 | lappend DEFAULT_VECTCFLAGS "-fno-math-errno" | |
805e2059 | 124 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-math-errno-*.\[cS\]]] \ |
db3cf6bd RG |
125 | "" $DEFAULT_VECTCFLAGS |
126 | ||
20f06221 DN |
127 | # -fwrapv tests |
128 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
129 | lappend DEFAULT_VECTCFLAGS "-fwrapv" | |
805e2059 | 130 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \ |
20f06221 DN |
131 | "" $DEFAULT_VECTCFLAGS |
132 | ||
a6b46ba2 DN |
133 | # -ftrapv tests |
134 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
135 | lappend DEFAULT_VECTCFLAGS "-ftrapv" | |
805e2059 | 136 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/trapv-*.\[cS\]]] \ |
07d05ffd JJ |
137 | "" $DEFAULT_VECTCFLAGS |
138 | ||
afa38a95 DN |
139 | # -fdump-tree-dceloop-details tests |
140 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
141 | lappend DEFAULT_VECTCFLAGS "-fdump-tree-dceloop-details" | |
142 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dump-tree-dceloop-*.\[cS\]]] \ | |
143 | "" $DEFAULT_VECTCFLAGS | |
144 | ||
a8b28492 DN |
145 | # -fno-tree-dce tests |
146 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
147 | lappend DEFAULT_VECTCFLAGS "-fno-tree-dce" | |
148 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dce-*.\[cS\]]] \ | |
149 | "" $DEFAULT_VECTCFLAGS | |
150 | ||
0be79f24 DN |
151 | # -fsection-anchors tests |
152 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
153 | lappend DEFAULT_VECTCFLAGS "-fsection-anchors" | |
154 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/section-anchors-*.\[cS\]]] \ | |
155 | "" $DEFAULT_VECTCFLAGS | |
156 | ||
8fd962e3 NF |
157 | # alignment-sensitive -fsection-anchors tests |
158 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
a3d7af04 SS |
159 | lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \ |
160 | "-fdump-ipa-increase_alignment-details" | |
8fd962e3 NF |
161 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \ |
162 | "" $DEFAULT_VECTCFLAGS | |
163 | ||
0be79f24 DN |
164 | # -fno-section-anchors tests |
165 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
166 | lappend DEFAULT_VECTCFLAGS "-fno-section-anchors" | |
167 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\[cS\]]] \ | |
168 | "" $DEFAULT_VECTCFLAGS | |
169 | ||
4192d75b VK |
170 | # -funswitch-loops tests |
171 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
172 | lappend DEFAULT_VECTCFLAGS "-funswitch-loops" | |
173 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\]]] \ | |
174 | "" $DEFAULT_VECTCFLAGS | |
175 | ||
bfcb9121 JC |
176 | # -fno-trapping-math tests |
177 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
178 | lappend DEFAULT_VECTCFLAGS "-fno-trapping-math" | |
179 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \ | |
180 | "" $DEFAULT_VECTCFLAGS | |
181 | ||
fbf798fc DN |
182 | # -fno-tree-scev-cprop |
183 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
184 | lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" | |
d29de1bf DN |
185 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS\]]] \ |
186 | "" $DEFAULT_VECTCFLAGS | |
187 | ||
69940d4d IR |
188 | # -fno-tree-scev-cprop |
189 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
190 | lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" | |
191 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]] \ | |
192 | "" $DEFAULT_VECTCFLAGS | |
193 | ||
d29de1bf DN |
194 | # -fno-tree-scev-cprop |
195 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
196 | lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" | |
197 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \ | |
198 | "" $DEFAULT_VECTCFLAGS | |
199 | ||
200 | # -fno-tree-scev-cprop -fno-tree-reassoc | |
201 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
202 | lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" "-fno-tree-reassoc" | |
203 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*.\[cS\]]] \ | |
204 | "" $DEFAULT_VECTCFLAGS | |
fbf798fc | 205 | |
805e2059 IR |
206 | # -fno-tree-scev-cprop |
207 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
208 | lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" | |
209 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\]]] \ | |
210 | "" $DEFAULT_VECTCFLAGS | |
211 | ||
f58e9734 DN |
212 | # -fno-tree-dominator-opts |
213 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
214 | lappend DEFAULT_VECTCFLAGS "-fno-tree-dominator-opts" | |
215 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]] \ | |
216 | "" $DEFAULT_VECTCFLAGS | |
217 | ||
805e2059 IR |
218 | # -fno-tree-pre |
219 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
220 | lappend DEFAULT_VECTCFLAGS "-fno-tree-pre" | |
221 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]] \ | |
222 | "" $DEFAULT_VECTCFLAGS | |
223 | ||
c12cc930 | 224 | # With -Os |
459e691a | 225 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS |
c12cc930 KB |
226 | lappend DEFAULT_VECTCFLAGS "-Os" |
227 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \ | |
228 | "" $DEFAULT_VECTCFLAGS | |
229 | ||
4ee279f2 DN |
230 | # With --param ggc-min-expand=0 --param ggc-min-heapsize=0 |
231 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
232 | lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0" | |
233 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ | |
234 | "" $DEFAULT_VECTCFLAGS | |
235 | ||
4979c28b RG |
236 | # -ftree-loop-if-convert-stores |
237 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
238 | lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores" | |
239 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \ | |
240 | "" $DEFAULT_VECTCFLAGS | |
241 | ||
c24aef95 RH |
242 | # With -O3. |
243 | # Don't allow IPA cloning, because it throws our counts out of whack. | |
459e691a | 244 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS |
92ec3570 | 245 | lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone" |
e4371462 IR |
246 | if [istarget "spu-*-*"] { |
247 | lappend DEFAULT_VECTCFLAGS "-funroll-loops" | |
248 | } | |
2b8775f3 | 249 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \ |
459e691a UB |
250 | "" $DEFAULT_VECTCFLAGS |
251 | ||
174f8765 IR |
252 | # With -O1 |
253 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \ | |
254 | "" $O1_VECTCFLAGS | |
255 | ||
75264e61 IR |
256 | # With -O |
257 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \ | |
258 | "" $O_VECTCFLAGS | |
259 | ||
a70d6342 IR |
260 | # -fno-tree-reassoc |
261 | set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS | |
262 | lappend VECT_SLP_CFLAGS "-fno-tree-reassoc" | |
263 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \ | |
264 | "" $VECT_SLP_CFLAGS | |
174f8765 | 265 | |
fb2c2b16 IR |
266 | # -fno-tree-fre |
267 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
268 | lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" | |
269 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \ | |
270 | "" $DEFAULT_VECTCFLAGS | |
271 | ||
ad949bcc JJ |
272 | # -fno-tree-fre -fno-tree-pre |
273 | set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS | |
274 | lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre" | |
275 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \ | |
276 | "" $DEFAULT_VECTCFLAGS | |
277 | ||
02b76a8d IR |
278 | # -fno-tree-sra |
279 | set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS | |
280 | lappend VECT_SLP_CFLAGS "-fno-tree-sra" | |
281 | dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \ | |
282 | "" $VECT_SLP_CFLAGS | |
283 | ||
284 | ||
07d05ffd JJ |
285 | # Clean up. |
286 | set dg-do-what-default ${save-dg-do-what-default} | |
79fe1b3b DN |
287 | |
288 | # All done. | |
289 | dg-finish |