Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / costmodel / x86_64 / x86_64-costmodel-vect.exp
blob66587e1090534de3ff48226a89fe0dc8371eb012
1 # Copyright (C) 1997, 2004, 2005, 2006, 2007 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.
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.
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.
19 # Load support procs.
20 load_lib gcc-dg.exp
22 # Exit immediately if this isn't a x86 target.
23 if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
24 || ![is-effective-target lp64] } then {
25 return
28 # Set up flags used for tests that don't specify options.
29 set DEFAULT_VECTCFLAGS ""
31 # These flags are used for all targets.
32 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model"
34 # If the target system supports vector instructions, the default action
35 # for a test is 'run', otherwise it's 'compile'. Save current default.
36 # Executing vector instructions on a system without hardware vector support
37 # is also disabled by a call to check_vect, but disabling execution here is
38 # more efficient.
39 global dg-do-what-default
40 set save-dg-do-what-default ${dg-do-what-default}
42 lappend DEFAULT_VECTCFLAGS "-msse2"
43 if [check_sse2_hw_available] {
44 set dg-do-what-default run
45 } else {
46 set dg-do-what-default compile
49 # Initialize `dg'.
50 dg-init
52 lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
54 # Main loop.
55 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
56 "" $DEFAULT_VECTCFLAGS
57 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
58 "" $DEFAULT_VECTCFLAGS
60 #### Tests with special options
61 global SAVED_DEFAULT_VECTCFLAGS
62 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
64 # -ffast-math tests
65 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
66 lappend DEFAULT_VECTCFLAGS "-ffast-math"
67 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
68 "" $DEFAULT_VECTCFLAGS
70 # Clean up.
71 set dg-do-what-default ${save-dg-do-what-default}
73 # All done.
74 dg-finish