[testsuite, rfa] Add gthreads dependency to some failing libstdc++ tests

Sandra Loosemore sandra@codesourcery.com
Thu Jan 24 18:53:00 GMT 2019


On 1/24/19 3:46 AM, Jonathan Wakely wrote:
> On 23/01/19 12:50 -0700, Sandra Loosemore wrote:
>> I ran libstdc++ tests on nios2-elf target.  I observed several new 
>> tests failing with
>>
>> error: 'mutex' in namespace 'std' does not name a type
>>
>> The definition of class mutex in include/bits/std_mutex.h is guarded 
>> with "#ifdef _GLIBCXX_HAS_GTHREADS" so I assume these tests are not 
>> supposed to work on this target.  This patch adds the equivalent 
>> dependency to the failing tests.
> 
> Those features *should* work without threads (if you don't have
> multiple threads, they don't need any synchronisation), but currently
> they use mutexes unconditionally.
> 
> The proper fix is to make them work without gthreads, something like
> https://gcc.gnu.org/ml/libstdc++/2018-12/msg00010.html
> 
>> OK to commit?  (I guess it is possible that this is actually a bug in 
>> the code instead, and the tests are supposed to pass....)
> 
> I'd prefer to XFAIL them, so that we remember to un-XFAIL them if/when
> I make them stop using mutexes. But we don't have a gthreads
> effective-target that would allow that, only the dg-require-gthreads
> directive.
> 
> Also this patch will skip the tests on AIX, which could run these
> tests if we added -pthread to the dg-options.
> 
> But these features are half-baked and experimental, and not going to
> get more changes in time for GCC 9, so OK for trunk.

Well, if this testsuite patch would indeed be papering over a bug, I 
think it's probably a bad idea to commit it.  For purposes of nios2-elf 
testing I can just track these as known failures for now, and not worry 
about them.

BTW, I'm more worried about the link errors introduced by the patch for 
PR 86756.  Those are regressions and apparently a problem that could 
affect user code, not just broken test cases for half-baked new features.

-Sandra



More information about the Libstdc++ mailing list