1 |
149 |
jeremybenn |
# Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
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
|
5 |
|
|
# the Free Software Foundation; either version 3 of the License, or
|
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
|
14 |
|
|
# along with GCC; see the file COPYING3. If not see
|
15 |
|
|
# .
|
16 |
|
|
|
17 |
|
|
# GCC testsuite that uses the `dg.exp' driver.
|
18 |
|
|
|
19 |
|
|
# Load support procs.
|
20 |
|
|
load_lib gcc-dg.exp
|
21 |
|
|
|
22 |
|
|
# Set up flags used for tests that don't specify options.
|
23 |
|
|
set DEFAULT_VECTCFLAGS ""
|
24 |
|
|
|
25 |
|
|
# These flags are used for all targets.
|
26 |
|
|
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize"
|
27 |
|
|
|
28 |
|
|
# If the target system supports vector instructions, the default action
|
29 |
|
|
# for a test is 'run', otherwise it's 'compile'. Save current default.
|
30 |
|
|
# Executing vector instructions on a system without hardware vector support
|
31 |
|
|
# is also disabled by a call to check_vect, but disabling execution here is
|
32 |
|
|
# more efficient.
|
33 |
|
|
global dg-do-what-default
|
34 |
|
|
set save-dg-do-what-default ${dg-do-what-default}
|
35 |
|
|
|
36 |
|
|
# Skip these tests for targets that do not support generating vector
|
37 |
|
|
# code. Set additional target-dependent vector flags, which can be
|
38 |
|
|
# overridden by using dg-options in individual tests.
|
39 |
|
|
if [istarget "powerpc*-*-*"] {
|
40 |
|
|
# Skip targets not supporting -maltivec.
|
41 |
|
|
if ![is-effective-target powerpc_altivec_ok] {
|
42 |
|
|
return
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
lappend DEFAULT_VECTCFLAGS "-maltivec"
|
46 |
|
|
if [check_vmx_hw_available] {
|
47 |
|
|
set dg-do-what-default run
|
48 |
|
|
} else {
|
49 |
|
|
if [is-effective-target ilp32] {
|
50 |
|
|
# Specify a cpu that supports VMX for compile-only tests.
|
51 |
|
|
lappend DEFAULT_VECTCFLAGS "-mcpu=7400"
|
52 |
|
|
}
|
53 |
|
|
set dg-do-what-default compile
|
54 |
|
|
}
|
55 |
|
|
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
|
56 |
|
|
lappend DEFAULT_VECTCFLAGS "-msse2"
|
57 |
|
|
set dg-do-what-default run
|
58 |
|
|
} elseif { [istarget "mipsisa64*-*-*"]
|
59 |
|
|
&& [check_effective_target_mpaired_single] } {
|
60 |
|
|
lappend DEFAULT_VECTCFLAGS "-mpaired-single"
|
61 |
|
|
set dg-do-what-default run
|
62 |
|
|
} elseif [istarget "sparc*-*-*"] {
|
63 |
|
|
lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
|
64 |
|
|
set dg-do-what-default run
|
65 |
|
|
} elseif [istarget "alpha*-*-*"] {
|
66 |
|
|
lappend DEFAULT_VECTCFLAGS "-mmax"
|
67 |
|
|
if [check_alpha_max_hw_available] {
|
68 |
|
|
set dg-do-what-default run
|
69 |
|
|
} else {
|
70 |
|
|
set dg-do-what-default compile
|
71 |
|
|
}
|
72 |
|
|
} elseif [istarget "ia64-*-*"] {
|
73 |
|
|
set dg-do-what-default run
|
74 |
|
|
} else {
|
75 |
|
|
return
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
# Initialize `dg'.
|
79 |
|
|
dg-init
|
80 |
|
|
|
81 |
|
|
# Tests that should be run without generating dump info
|
82 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \
|
83 |
|
|
"" $DEFAULT_VECTCFLAGS
|
84 |
|
|
|
85 |
|
|
lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
|
86 |
|
|
|
87 |
|
|
# Main loop.
|
88 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \
|
89 |
|
|
"" $DEFAULT_VECTCFLAGS
|
90 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \
|
91 |
|
|
"" $DEFAULT_VECTCFLAGS
|
92 |
|
|
|
93 |
|
|
#### Tests with special options
|
94 |
|
|
global SAVED_DEFAULT_VECTCFLAGS
|
95 |
|
|
set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
|
96 |
|
|
|
97 |
|
|
# -ffast-math tests
|
98 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
99 |
|
|
lappend DEFAULT_VECTCFLAGS "-ffast-math"
|
100 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-vect*.\[cS\]]] \
|
101 |
|
|
"" $DEFAULT_VECTCFLAGS
|
102 |
|
|
|
103 |
|
|
# -fwrapv tests
|
104 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
105 |
|
|
lappend DEFAULT_VECTCFLAGS "-fwrapv"
|
106 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wrapv-vect*.\[cS\]]] \
|
107 |
|
|
"" $DEFAULT_VECTCFLAGS
|
108 |
|
|
|
109 |
|
|
# -ftrapv tests
|
110 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
111 |
|
|
lappend DEFAULT_VECTCFLAGS "-ftrapv"
|
112 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/trapv-vect*.\[cS\]]] \
|
113 |
|
|
"" $DEFAULT_VECTCFLAGS
|
114 |
|
|
|
115 |
|
|
# -fdump-tree-dceloop-details tests
|
116 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
117 |
|
|
lappend DEFAULT_VECTCFLAGS "-fdump-tree-dceloop-details"
|
118 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dump-tree-dceloop-*.\[cS\]]] \
|
119 |
|
|
"" $DEFAULT_VECTCFLAGS
|
120 |
|
|
|
121 |
|
|
# -fno-tree-dce tests
|
122 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
123 |
|
|
lappend DEFAULT_VECTCFLAGS "-fno-tree-dce"
|
124 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dce-*.\[cS\]]] \
|
125 |
|
|
"" $DEFAULT_VECTCFLAGS
|
126 |
|
|
|
127 |
|
|
# -fsection-anchors tests
|
128 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
129 |
|
|
lappend DEFAULT_VECTCFLAGS "-fsection-anchors"
|
130 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/section-anchors-*.\[cS\]]] \
|
131 |
|
|
"" $DEFAULT_VECTCFLAGS
|
132 |
|
|
|
133 |
|
|
# -fno-section-anchors tests
|
134 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
135 |
|
|
lappend DEFAULT_VECTCFLAGS "-fno-section-anchors"
|
136 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\[cS\]]] \
|
137 |
|
|
"" $DEFAULT_VECTCFLAGS
|
138 |
|
|
|
139 |
|
|
# -funswitch-loops tests
|
140 |
|
|
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
|
141 |
|
|
lappend DEFAULT_VECTCFLAGS "-funswitch-loops"
|
142 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\]]] \
|
143 |
|
|
"" $DEFAULT_VECTCFLAGS
|
144 |
|
|
|
145 |
|
|
# With -Os
|
146 |
|
|
lappend DEFAULT_VECTCFLAGS "-Os"
|
147 |
|
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \
|
148 |
|
|
"" $DEFAULT_VECTCFLAGS
|
149 |
|
|
|
150 |
|
|
# Clean up.
|
151 |
|
|
set dg-do-what-default ${save-dg-do-what-default}
|
152 |
|
|
|
153 |
|
|
# All done.
|
154 |
|
|
dg-finish
|