diff --git a/src/regression/tls_get_new-dtv.c b/src/regression/tls_get_new-dtv.c new file mode 100644 index 0000000..a183fff --- /dev/null +++ b/src/regression/tls_get_new-dtv.c @@ -0,0 +1,38 @@ +// __tls_get_new did not allocate new dtv for threads properly +#include +#include +#include "test.h" + +#define N 10 + +#define T(c) ((c) || (t_error(#c " failed\n"),0)) + +static pthread_barrier_t b; +static void *mod; + +static void *start(void *a) +{ + void *(*f)(void); + + pthread_barrier_wait(&b); + T(f = dlsym(mod, "f")); + f(); + return 0; +} + +int main() +{ + pthread_t td[N]; + int i; + + pthread_barrier_init(&b, 0, N+1); + for (i=0; i