This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] fix thread test cases for solaris.
- From: Andreas Tobler <andreast-list at fgznet dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 10 Jan 2009 19:28:00 +0100
- Subject: [patch] fix thread test cases for solaris.
Hi all,
The below test cases fail under sparc-solaris10, undefined reference to
sched_yield or nanosleep. Those are part of librt.
This simple patch makes these test cases compile and run under
sparc-solaris10. (Not supported under solaris8)
Ok for trunk?
Thanks,
Andreas
2009-01-10 Andreas Tobler <a.tobler@schweiz.org>
* testsuite/30_threads/thread/this_thread/2.cc: Add -lrt to
dg-options for solaris targets.
* testsuite/30_threads/thread/this_thread/3.cc: Likewise.
* testsuite/30_threads/thread/this_thread/4.cc: Likewise.
Index: 30_threads/thread/this_thread/2.cc
===================================================================
--- 30_threads/thread/this_thread/2.cc (revision 143227)
+++ 30_threads/thread/this_thread/2.cc (working copy)
@@ -1,6 +1,6 @@
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
-// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x -pthreads -lrt" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
Index: 30_threads/thread/this_thread/3.cc
===================================================================
--- 30_threads/thread/this_thread/3.cc (revision 143227)
+++ 30_threads/thread/this_thread/3.cc (working copy)
@@ -1,6 +1,6 @@
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
-// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x -pthreads -lrt" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
Index: 30_threads/thread/this_thread/4.cc
===================================================================
--- 30_threads/thread/this_thread/4.cc (revision 143227)
+++ 30_threads/thread/this_thread/4.cc (working copy)
@@ -1,6 +1,6 @@
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
-// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x -pthreads -lrt" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }