This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Testsuite patch for Solaris 10


On Fri, Nov 12, 2004 at 08:42:59PM +0000, Joseph S. Myers wrote:
> AMD64 Solaris 10 defaults to 32-bit compilation so has target triple
> i386-pc-solaris2.10, but builds 64-bit multilibs.  Various testcases
> that are for i?86-*-* only, not x86_64-*-*, need to disable the use of
> -m64.  This patch (around a third of the changes present on
> csl-sol210-branch) adds dg-forbid-option to achieve this.  As various
> significant test harness changes have been being discussed lately for
> mainline, I hope this too can be considered for mainline now.

Joseph,

I've got an idea for a simpler way to do this.

Recently I added the following procedures in target-supports.exp and
gcc-dg.exp:

is-effective-target  takes a keyword and returns 1 or 0 depending on the
                     value returned by the associated check_* proc

dg-require-effective-target  passes the keyword argument to
                     is-effective-target and skips the test if that
                     procedure returns 0

dg-target-list       takes keyword "target", "xfail", or "" and the
                     result of a TCL condition and turns it into a list
                     with the keyword followed by "*-*-*" or
                     "empty-empty-empty"
 
It occurred to me today that dg-require-effective-target could be
replaced by a more generic

dg-require           skips the test (as unsupported) if the argument
                     (the result of a TCL expression) is 0

to be used, for example, as:

  { dg-require [is-effective-target lp64] }

or 

  { dg-require [expr [is-effective-target vect_int] && [is-effective-target vect_align]] }

You could turn the guts of dg-forbid-option into:

is-option            returns 1 if the argument, a regular expression,
                     matches the command-line options implied by the
                     current multilib, 0 otherwise

This would let

  { dg-do-run { target i?86-*-* } }
  { dg-forbid-option "-m64" }

be replaced by

  { dg-require [expr [istarget i?86-*-*] && [expr ![is-option "-m64"]]] }

What do you think, besides the daunting task of updating all those
tests?

Janis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]