gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads.
[platform/upstream/binutils.git] / gdb / testsuite / gdb.threads / tls-shared.c
index d4f8e5c..02b1308 100644 (file)
@@ -1,6 +1,11 @@
+
+#include <pthread.h>
+
 __thread int i_tls = 1;
 int foo ()
 {
+  /* Ensure we link against pthreads even with --as-needed.  */
+  pthread_testcancel();
   return i_tls;
 }