This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 "" }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]