[v3] c++0x <mutex> and <condition_variable>
Paolo Carlini
paolo.carlini@oracle.com
Tue Sep 2 22:00:00 GMT 2008
Hi Chris,
> One thing that's unclear to me is how to determine the targets in the
> testcase's dg-do run option. I'm just using what I think Benjamin (or
> whoever did the initial commit) was using. I'm not sure how to go
> about determining whether its still correct or not.
>
We should be very careful indeed. I did these issues a bit of thought.
For anything using threads I think we need the same dg-* directives we
have in the shared_ptr tests, for instance and known to be safe:
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris*
*-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd*
*-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
// { dg-options "-pthreads -std=gnu++0x" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ in case the test relies on the new gthread support, we need a new
dg-require very similar to the one I added for the atomic builtins (look
for check_v3_target_atomic_builtins) checking that <bits/c++config.h>
defines _GLIBCXX_HAS_GTHREADS. Likewise for any other feature required
for the correct build and run of the test (__GTHREAD_HAS_COND?!?).
Really rather mechanical additions.
That way the dg-* directives should ok. Maybe a little redundant in case
of dg-require for gthreads, because likely many of the above targets
currently do not use posix threads, but safe, anyway and ready in case
further threading models besides posix define the C++0x functions.
Paolo.
More information about the Libstdc++
mailing list