1 2 #include <pthread.h> 3 4 __thread int i_tls = 1; foo()5 int foo () 6 { 7 /* Ensure we link against pthreads even with --as-needed. */ 8 pthread_testcancel(); 9 return i_tls; 10 } 11 12