From 91ffe356293c90378b8deb7e82262ade077f29dc Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 7 Jun 2011 16:43:29 +0000 Subject: [PATCH] re PR tree-optimization/48497 (gfortran.dg/graphite/vect-pr40979.f90 FAILs without -march=pentium4) gcc: PR tree-optimization/48497 * doc/sourcebuild.texi (Directives, dg-additional-options): Document. gcc/testsuite: PR tree-optimization/48497 * lib/gcc-defs.exp (dg-additional-options): New proc. * gfortran.dg/graphite/vect-pr40979.f90: Use dg-additional-options -msse2 on 32-bit x86. From-SVN: r174759 --- gcc/ChangeLog | 5 +++++ gcc/doc/sourcebuild.texi | 5 +++++ gcc/testsuite/ChangeLog | 8 +++++++ .../gfortran.dg/graphite/vect-pr40979.f90 | 1 + gcc/testsuite/lib/gcc-defs.exp | 22 +++++++++++++++++++ 5 files changed, 41 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 932e8e1d1ff..1986a889263 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Rainer Orth + + PR tree-optimization/48497 + * doc/sourcebuild.texi (Directives, dg-additional-options): Document. + 2011-06-07 Bill Schmidt PR tree-optimization/46728 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 1e02809dd65..64210c21bc9 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1016,6 +1016,11 @@ This directive does nothing on targets that enable the features by default, or that don't provide them at all. It must come after all @code{dg-options} directives. For supported values of @var{feature} see @ref{Add Options, ,}. + +@item @{ dg-additional-options @var{options} [@{ target @var{selector} @}] @} +This directive provides a list of compiler options, to be used +if the target system matches @var{selector}, that are added to the default +options used for this set of tests. @end table @subsubsection Modify the test timeout value diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b38cd1e6770..1372638aef8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-06-07 Rainer Orth + + gcc/testsuite: + PR tree-optimization/48497 + * lib/gcc-defs.exp (dg-additional-options): New proc. + * gfortran.dg/graphite/vect-pr40979.f90: Use dg-additional-options + -msse2 on 32-bit x86. + 2011-06-06 Jason Merrill * g++.dg/cpp0x/enum19.C: New. diff --git a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 index 662b82a12a0..f620d0c85cc 100644 --- a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 +++ b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 @@ -1,5 +1,6 @@ ! { dg-do compile } ! { dg-require-effective-target vect_double } +! { dg-additional-options "-msse2" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } module mqc_m integer, parameter, private :: longreal = selected_real_kind(15,90) diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index ed8c04170f5..f48520e46ab 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -183,6 +183,28 @@ if { [info procs runtest_file_p] == "" } then { } } +# Like dg-options, but adds to the default options rather than replacing them. + +proc dg-additional-options { args } { + upvar dg-extra-tool-flags extra-tool-flags + + if { [llength $args] > 3 } { + error "[lindex $args 0]: too many arguments" + return + } + + if { [llength $args] >= 3 } { + switch [dg-process-target [lindex $args 2]] { + "S" { eval lappend extra-tool-flags [lindex $args 1] } + "N" { } + "F" { error "[lindex $args 0]: `xfail' not allowed here" } + "P" { error "[lindex $args 0]: `xfail' not allowed here" } + } + } else { + eval lappend extra-tool-flags [lindex $args 1] + } +} + # Record additional sources files that must be compiled along with the # main source file. -- 2.30.2