From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25741 invoked by alias); 2 Aug 2012 18:39:01 -0000 Received: (qmail 25727 invoked by uid 22791); 2 Aug 2012 18:39:00 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Aug 2012 18:38:46 +0000 Received: by wibhm11 with SMTP id hm11so4073805wib.12 for ; Thu, 02 Aug 2012 11:38:45 -0700 (PDT) Received: by 10.180.19.169 with SMTP id g9mr6853582wie.9.1343932725456; Thu, 02 Aug 2012 11:38:45 -0700 (PDT) Received: from localhost ([2.26.188.227]) by mx.google.com with ESMTPS id z11sm19168260wiv.10.2012.08.02.11.38.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 11:38:44 -0700 (PDT) From: Richard Sandiford To: "Maciej W. Rozycki" Mail-Followup-To: "Maciej W. Rozycki" ,Alan Modra , , rdsandiford@googlemail.com Cc: Alan Modra , Subject: Re: [PATCH] MIPS: Enable NewABI tests for SDE targets References: Date: Thu, 02 Aug 2012 18:39:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Wed, 1 Aug 2012 15:42:32 +0100") Message-ID: <87ipd1nnpb.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00037.txt.bz2 > Index: binutils-fsf-trunk-quilt/ld/testsuite/lib/ld-lib.exp > =================================================================== > --- binutils-fsf-trunk-quilt.orig/ld/testsuite/lib/ld-lib.exp 2012-07-24 15:29:41.000000000 +0100 > +++ binutils-fsf-trunk-quilt/ld/testsuite/lib/ld-lib.exp 2012-07-26 03:08:32.951798913 +0100 > @@ -431,7 +431,7 @@ proc ld_simple_link_defsyms {} { > return $flags > } > > -# run_dump_test FILE > +# run_dump_test FILE (optional:) EXTRA_OPTIONS > # Copied from gas testsuite, tweaked and further extended. > # > # Assemble a .s file, then run some utility on it and check the output. > @@ -456,6 +456,12 @@ proc ld_simple_link_defsyms {} { > # list ends with the first line that doesn't match the above syntax > # (hmm, not great for error detection). > # > +# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of > +# two-element lists. The first element of each is an option name, and > +# the second additional arguments to be added on to the end of the > +# option list as given in FILE.d. (If omitted, no additional options > +# are added.) > +# > # The interesting options are: > # > # name: TEST-NAME > @@ -503,6 +509,11 @@ proc ld_simple_link_defsyms {} { > # More than one "source" directive can be given, which is useful > # when testing linking. > # > +# dump: DUMP > +# Match against DUMP.d. If omitted, this defaults to FILE.d. This > +# is useful if several .d files differ by options only. Options are > +# always read from FILE.d. > +# > # xfail: TARGET > # The test is expected to fail on TARGET. This may occur more than > # once. > @@ -534,7 +545,7 @@ proc ld_simple_link_defsyms {} { > # regexps in FILE.d. `regexp_diff' is defined in binutils-common.exp; > # see further comments there. > # > -proc run_dump_test { name } { > +proc run_dump_test { name {extra_options {}} } { > global subdir srcdir > global OBJDUMP NM AS OBJCOPY READELF LD > global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS LDFLAGS I think extra_options ought to be a one-level list, i.e. {key1 value key2 value2 ...}. That makes the calls simpler (because there's one fewer [list ...]) and: > + foreach i $extra_options { > + set opt_name [lindex $i 0] > + set opt_val [lindex $i 1] > + if ![info exists opts($opt_name)] { > + perror "unknown option $opt_name given in extra_opts" > + unresolved $subdir/$name > + return > + } > + # Add extra option to end of existing option, adding space > + # if necessary. > + if { ![regexp "warning|error" $opt_name] > + && [string length $opts($opt_name)] } { > + append opts($opt_name) " " > + } > + append opts($opt_name) $opt_val > + } reduces to: foreach { opt_name opt_val } $extra_options { if ![info exists opts($opt_name)] { perror "unknown option $opt_name given in extra_opts" unresolved $subdir/$name return } # Add extra option to end of existing option, adding space # if necessary. if { ![regexp "warning|error" $opt_name] && [string length $opts($opt_name)] } { append opts($opt_name) " " } append opts($opt_name) $opt_val } OK with that change, thanks. OK for the follow-up too. Richard