This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] [binutils][testsuite] Allow multiple lines of "as" in testsuite.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Matthew Malcomson <Matthew dot Malcomson at arm dot com>
- Cc: nd <nd at arm dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>, "nickc at redhat dot com" <nickc at redhat dot com>
- Date: Fri, 1 Mar 2019 08:21:45 -0800
- Subject: Re: [Patch] [binutils][testsuite] Allow multiple lines of "as" in testsuite.
- References: <VI1PR0801MB2014E9F7826E67FDBCB173C3E0680@VI1PR0801MB2014.eurprd08.prod.outlook.com> <cdc3ae1a-1901-8fb4-d0fc-39cd55b7512f@redhat.com> <VI1PR0801MB2014AC4C9FC28CE5F2E4CF3AE07E0@VI1PR0801MB2014.eurprd08.prod.outlook.com> <03912292-63ff-257d-ecd4-1e96f7f634dc@redhat.com> <aa9de3f1-44b9-9a34-3a3b-b2be6c28e6c4@arm.com> <bb726c55-1676-c684-65a9-7e5b77c040c7@redhat.com> <VI1PR0801MB20140959A19BE16B95FA046EE07F0@VI1PR0801MB2014.eurprd08.prod.outlook.com> <1bffa964-15e6-73fe-e194-43d095528f80@redhat.com> <CAMe9rOrSqo-KqdfDO5Ri9sW4zMvcEaL8Z4QQptLzSnVgnkY6YQ@mail.gmail.com> <VI1PR0801MB2014A8D039A689D78DA1B8FBE0750@VI1PR0801MB2014.eurprd08.prod.outlook.com>
On Thu, Feb 28, 2019 at 5:46 AM Matthew Malcomson
<Matthew.Malcomson@arm.com> wrote:
>
> > On Tue, Feb 26, 2019 at 8:05 AM Nick Clifton <nickc@redhat.com> wrote:
> > >
> >
> > This breaks RHEL 7:
>
>
> > invalid command name "lmap"
>
>
> Thanks for the catch!
>
>
> My previous patch adding the ability to have multiple "as" lines in a testcase
> used a TCL feature introduced in TCL version 8.6 (the lmap procedure).
> https://www.sourceware.org/ml/binutils/2019-02/msg00097.html
>
> This doesn't work on distributions that have an older version of TCL.
> https://www.sourceware.org/ml/binutils/2019-02/msg00131.html
>
> The attached patch rewrites the sole part of the code that uses "lmap" to use
> "foreach" instead.
>
> Tested on cross compilers
> mipsel-linux-gnu mipsisa32el-linux-gnu powerpc-ibm-aix5.2.0
> aarch64-none-linux-gnu arm-none-linux-gnu aarch64-none-elf
>
> And native x86_64-none-linux-gnu, both with TCL 8.6 and 8.5.
>
> binutils/ChangeLog:
>
> 2019-02-28 Matthew Malcomson <matthew.malcomson@arm.com>
>
> * testsuite/lib/binutils-common.exp (run_dump_test): Replace a use of
> "lmap" with a "foreach" loop.
>
>
>
> ############### Attachment also inlined for ease of reply ###############
>
>
> diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
> index e01b3fb48462cbe6b5bd06ae8860a1e1a8c8e5e6..8f622ba6b4a5adcfe027ebbbdcbb6bac62829203 100644
> --- a/binutils/testsuite/lib/binutils-common.exp
> +++ b/binutils/testsuite/lib/binutils-common.exp
> @@ -829,19 +829,19 @@ proc run_dump_test { name {extra_options {}} } {
> }
> }
>
> - # Ensure there is something in $opts(as) for the lmap below.
> + # Ensure there is something in $opts(as) for the foreach loop below.
> if { [llength $opts(as)] == 0 } {
> set opts(as) [list " "]
> }
> - set as_final_flags [lmap x $opts(as) {
> + foreach x $opts(as) {
> if { [string length $x] && [string length $as_additional_flags] } {
> append x " "
> }
> append x $as_additional_flags
> regsub {\[big_or_little_endian\]} $x \
> [big_or_little_endian] x
> - expr {$x}
> - }]
> + lappend as_final_flags $x
> + }
>
> regsub {\[big_or_little_endian\]} $opts(ld) \
> [big_or_little_endian] opts(ld)
>
>
I opened:
https://sourceware.org/bugzilla/show_bug.cgi?id=24287
Would you mind mention PR binutils/24287 in your ChangeLog?
Thanks.
--
H.J.