1 # Copyright (C) 1997, 2004 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 2 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 this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # GCC testsuite that uses the `dg.exp' driver.
22 # Set up flags used for tests that don't specify options.
23 set DEFAULT_VECTCFLAGS ""
25 # These flags are used for all targets.
26 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fdump-tree-vect-stats"
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
33 global dg-do-what-default
34 set save-dg-do-what-default ${dg-do-what-default}
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 # If there are powerpc targets to skip, do it here.
42 lappend DEFAULT_VECTCFLAGS "-maltivec"
43 if [check_vmx_hw_available] {
44 set dg-do-what-default run
46 if [is-effective-target ilp32] {
47 # Specify a cpu that supports VMX for compile-only tests.
48 lappend DEFAULT_VECTCFLAGS "-mcpu=7400"
50 set dg-do-what-default compile
52 } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
53 lappend DEFAULT_VECTCFLAGS "-msse2"
54 set dg-do-what-default run
55 } elseif [istarget "mipsisa64*-*-*"] {
56 lappend DEFAULT_VECTCFLAGS "-mpaired-single"
57 set dg-do-what-default run
58 } elseif [istarget "sparc*-*-*"] {
59 lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
60 set dg-do-what-default run
69 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
70 "" $DEFAULT_VECTCFLAGS
73 set dg-do-what-default ${save-dg-do-what-default}