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 02:23:10PM -0800, Mike Stump wrote:
> On Friday, November 12, 2004, at 02:04  PM, Joseph S. Myers wrote:
> >It's not clear to me that embedding pieces of TCL code syntax in
> >individual tests [ ... ] is an improvement.  It seems desirable for 
> >the test format to be seen as a specification independent of 
> >implementation language - which might, for example, be used with 
> >QMTest's DejaGnu emulation, not just with the
> >particular current harness.
> 
> I strongly agree.  The flexibility to swap out dejagnu/tcl, is an 
> important design point.  When possible, I think it is good to keep 
> tests clean of tcl bits.
> 

I had hoped to use TCL expressions like this (without line breaks):

  { dg-do run [dg-target-list target
       [expr [expr [istarget i?86-*-*]
              || [expr [istarget powerpc-*-linux]]
                  && [is-effective-target ilp32]]] }

It made sense to me to use an existing embedded scripting language, but
I understand the reasons for not doing that.

My needs are simple: logical and, logical or, and logical not, with the
possibility of adding other logical operators later.  Operands are
procedures in .exp files that return 1 or 0.  Much to my relief, I found
that these procs:

    proc dg-and { op1 op2 } {
        return [expr $op1 && $op2]
    }
    proc dg-or { op1 op2 } {
        return [expr $op1 || $op2]
    }
    proc dg-not { op } {
        return [expr ! $op]
    }

are evaluated before entering the proc to which their results are
passed as arguments, so I can do:

  { dg-do run [dg-target-list target
       [dg-and [dg-or [istarget i?86-*-*] [istarget powerpc-*-linux]]
               [is-effective-target ilp32]]] }

Would it be acceptable to do things like this within tests?

Janis


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