-# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2007, 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
# Test that the correct data prefetch instructions (SSE or 3DNow! variant,
# or none) are used for various i386 cpu-type and instruction set
# Load support procs.
load_lib gcc-dg.exp
+load_lib torture-options.exp
# Initialize harness.
dg-init
+torture-init
-# Save these. They are needed if testsuite loops over multiple ABIs
-set saved_torture_with_loops $torture_with_loops
-set saved_torture_without_loops $torture_without_loops
+if { [board_info target exists multilib_flags]
+ && [string match "* -march=*" " [board_info target multilib_flags] "] } {
+ # Multilib flags come after the -march flags we pass and override
+ # them, so skip these tests when such flags are passed.
+ return
+}
-set torture_with_loops $PREFETCH_NONE
-set torture_without_loops $PREFETCH_NONE
+set-torture-options $PREFETCH_NONE
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-none-*.c]] ""
-set torture_with_loops $PREFETCH_SSE
-set torture_without_loops $PREFETCH_SSE
+set-torture-options $PREFETCH_SSE
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-sse-*.c]] ""
-set torture_with_loops $PREFETCH_3DNOW
-set torture_without_loops $PREFETCH_3DNOW
+set-torture-options $PREFETCH_3DNOW
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-3dnow-*.c]] ""
-set torture_with_loops $PREFETCH_ATHLON
-set torture_without_loops $PREFETCH_ATHLON
+set-torture-options $PREFETCH_ATHLON
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-athlon-*.c]] ""
-set torture_with_loops $saved_torture_with_loops
-set torture_without_loops $saved_torture_without_loops
-
+torture-finish
dg-finish