1 # Copyright (C) 1997, 2004, 2005, 2006, 2007, 2008
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with GCC; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
18 # GCC testsuite that uses the `dg.exp' driver.
23 # Exit immediately if this isn't a x86 target.
24 if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
25 || [is-effective-target ia32] } then {
29 # Set up flags used for tests that don't specify options.
30 set DEFAULT_VECTCFLAGS ""
32 # These flags are used for all targets.
33 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model"
35 # If the target system supports vector instructions, the default action
36 # for a test is 'run', otherwise it's 'compile'. Save current default.
37 # Executing vector instructions on a system without hardware vector support
38 # is also disabled by a call to check_vect, but disabling execution here is
40 global dg-do-what-default
41 set save-dg-do-what-default ${dg-do-what-default}
43 lappend DEFAULT_VECTCFLAGS "-msse2"
44 if [check_sse2_hw_available] {
45 set dg-do-what-default run
47 set dg-do-what-default compile
53 lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
56 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
57 "" $DEFAULT_VECTCFLAGS
58 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
59 "" $DEFAULT_VECTCFLAGS
61 #### Tests with special options
62 global SAVED_DEFAULT_VECTCFLAGS
63 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
66 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
67 lappend DEFAULT_VECTCFLAGS "-ffast-math"
68 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
69 "" $DEFAULT_VECTCFLAGS
72 set dg-do-what-default ${save-dg-do-what-default}