[PATCH] MIPS: If a test in the MIPS testsuite requires standard library support check the sysroot supports the required test options.

Moore, Catherine Catherine_Moore@mentor.com
Thu Nov 17 21:52:00 GMT 2016



> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Matthew Fortune
> Sent: Thursday, November 17, 2016 8:47 AM
> To: Toma Tabacu <Toma.Tabacu@imgtec.com>; Andrew Bennett
> <Andrew.Bennett@imgtec.com>; Moore, Catherine
> <Catherine_Moore@mentor.com>; 'gcc-patches@gcc.gnu.org' <gcc-
> patches@gcc.gnu.org>
> Subject: RE: [PATCH] MIPS: If a test in the MIPS testsuite requires
> standard library support check the sysroot supports the required test
> options.
> 
> Toma Tabacu <Toma.Tabacu@imgtec.com> writes:
> > Hi,
> >
> > The patch below is a rebased version of Andrew's patch plus a few
> more changes
> > to test options.
> >
> > I have tested Andrew's patch by passing -msoft-float to the testsuite
> without
> > having a soft-float library available, and saw that the inline-memcpy-
> {1,2,3,4,5}.c
> > and memcpy-1.c tests were also failing to find standard library
> headers.
> > In the version below, I have added (REQUIRES_STDLIB) to them as
> well.
> >
> > However, I believe that the memcpy-1.c test was removed from the
> first version
> > of Andrew's patch in response to Matthew's comments, but I don't
> think it
> > should be.
> >
> > Tested with mips-img-linux-gnu and mips-mti-linux-gnu.
> 
> This looks OK to me but I then again I helped with the design for this.
> 
> I'd like to give Catherine a chance to take a look though as the feature
> is unusual.
> 
> One comment below.
> 
> > diff --git a/gcc/testsuite/gcc.target/mips/mips.exp
> > b/gcc/testsuite/gcc.target/mips/mips.exp
> > index e22d782..ccd4ecb 100644
> > --- a/gcc/testsuite/gcc.target/mips/mips.exp
> > +++ b/gcc/testsuite/gcc.target/mips/mips.exp
> > @@ -1420,6 +1426,22 @@ proc mips-dg-options { args } {
> >  	}
> >      }
> >
> > +    # If the test is marked as requiring standard libraries check
> > +    # that the sysroot has support for the current set of test options.
> > +    if { [mips_have_test_option_p options "REQUIRES_STDLIB"] } {
> > +	mips_push_test_options saved_options $extra_tool_flags
> > +	set output [mips_preprocess "" {
> > +	      #include <stdlib.h>
> > +	} 1]
> > +	mips_pop_test_options saved_options
> > +
> > +	# If the preprocessing of the stdlib.h file produced errors mark
> > +	# the test as unsupported.
> > +	if { ![string equal $output ""] } {
> > +	    set do_what [lreplace $do_what 1 1 "N"]
> 
> We should describe what we expect the format of do_what to be at
> the time
> of writing in case it ever changes. i.e. a comment to say what the
> second
> character means and therefore make it clear that setting it to 'n' makes
> the test unsupported.
> 

This patch looks okay to me after updating the comment as Matthew suggested.



More information about the Gcc-patches mailing list