1 # Copyright (C) 2004, 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.
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 # There's a bunch of headers we need.
21 foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
22 remote_download host $header
28 load_lib target-supports.exp
30 # If the target system supports vector instructions, the default action
31 # for a test is 'run', otherwise it's 'compile'. Save current default.
32 # Executing vector instructions on a system without hardware vector support
33 # is also disabled by a call to check_vect, but disabling execution here is
35 global dg-do-what-default
36 set save-dg-do-what-default ${dg-do-what-default}
38 # Set up flags used for tests that don't specify options.
39 set DEFAULT_VECTCFLAGS ""
41 # These flags are used for all targets.
42 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
43 "-ftree-vectorizer-verbose=4" "-fdump-tree-vect-stats"
45 # Skip these tests for targets that do not support generating vector
46 # code. Set additional target-dependent vector flags, which can be
47 # overridden by using dg-options in individual tests.
48 if [istarget "powerpc*-*-*"] {
49 # Skip targets not supporting -maltivec.
50 if ![is-effective-target powerpc_altivec_ok] {
54 lappend DEFAULT_VECTCFLAGS "-maltivec"
55 if [check_vmx_hw_available] {
56 set dg-do-what-default run
58 if [is-effective-target ilp32] {
59 # Specify a cpu that supports VMX for compile-only tests.
60 lappend DEFAULT_VECTCFLAGS "-mcpu=7400"
62 set dg-do-what-default compile
64 } elseif { [istarget "spu-*-*"] } {
65 set dg-do-what-default run
66 } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
67 lappend DEFAULT_VECTCFLAGS "-msse2"
68 set dg-do-what-default run
69 } elseif { [istarget "mips*-*-*"]
70 && [check_effective_target_mpaired_single]
71 && [check_effective_target_nomips16] } {
72 lappend DEFAULT_VECTCFLAGS "-mpaired-single"
73 set dg-do-what-default run
74 } elseif [istarget "sparc*-*-*"] {
75 lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
76 set dg-do-what-default run
77 } elseif [istarget "alpha*-*-*"] {
78 lappend DEFAULT_VECTCFLAGS "-mmax"
79 if [check_alpha_max_hw_available] {
80 set dg-do-what-default run
82 set dg-do-what-default compile
84 } elseif [istarget "ia64-*-*"] {
85 set dg-do-what-default run
95 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,cc,S} ]] \
96 "" $DEFAULT_VECTCFLAGS
98 #### Tests with special options
99 global SAVED_DEFAULT_VECTCFLAGS
100 set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
102 # --param max-aliased-vops=0
103 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
104 lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0"
105 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/param-max-aliased*.\[cS\]]] \
106 "" $DEFAULT_VECTCFLAGS
109 set dg-do-what-default ${save-dg-do-what-default}