[v3] Use pthread effective-target in testsuite
Jonathan Wakely
jwakely@redhat.com
Thu Jun 15 11:17:00 GMT 2017
On 15/06/17 11:13 +0200, Rainer Orth wrote:
>I've recently been reminded that the pthread tests in libstdc++ still
>use insanely long lists of targets to control where they are run. I'd
>several times promised to do something about that, and here's the patch
>that finally does.
>
>The patch is mostly mechanical (and those parts were produced by a short
>perl script), but a couple of issues bear comments or pose questions:
>
>* For all tests using -pthread, I've removed the target lists from both
> dg-do run and dg-options, replacing them by
> dg-require-effective-target pthread instead.
>
>* 4 tests in 30_threads/shared_mutex use -std=gnu++17 in addition to
> -pthread, but in a weird way: most targets use both options, but three
> (*-*-darwin*, *-*-cygwin, *-*-rtems) only pass -std=gnu++17. I've no
> idea why and think this is unnecessary:
>
>** Darwin is just a regular pthreads target, so this should work just
> fine.
>
>** Cygwin (and MingW) both understand -pthread as well. If there's some
> reason *not* to use it here, it should be explained in the tests and
> made explicit.
>
>** RTEMS just ignores -pthread according to gcc/config/rtems.opt, so we
> should be fine with just passing it anyway.
Looks good, thanks for the analysis.
>* The two forced_unwind.cc tests are GNU specific (__forced_unwind
> exception) and time out on Solaris when I tried, so I've left the
> target list as is. I've just removed the target list from dg-options
> (which is unnecessary duplication and incorrectly included
> *-*-solaris* in one case) and added the pthread effective-target
> although that's not strictly necessary.
OK.
>* In 30_threads/this_thread/57060.cc I've moved the c++11 requirement to
> dg-require-effective-target for symmetry.
Nice.
>Two testcases I've left alone:
>
>* 18_support/bad_exception/23591_thread-1.c requires -ftable-verify
> support; one could add the pthread effective target and eventually
> replace the explicit (possibly incomplete) target list, but that's for
> another time.
>
>* ext/mt_allocator/22309_thread.cc is currently restricted to
> *-*-linux*, *-*-gnu*, but I don't immediately see why it couldn't work
> on other targets with dlopen and friends.
OK, leaving them alone is fine.
>I've refrained from creating a 200+ entry ChangeLog entry for the
>mechanical part, but could do so if required.
No, this is fine.
>Bootstrapped without regressions on i386-pc-solaris2.12,
>sparc-sun-solaris2.12, and x86_64-pc-linux-gnu.
>
>Did some limited testing on x86_64-apple-darwin16.7.0, but Darwin
>testing is currently massively hampered by PR bootstrap/81033.
>
>Ok for mainline?
Yes please. This makes me very happy, thank you!
More information about the Libstdc++
mailing list