From 79af0fbbf1e6b52196c55f0adc4fd4395a91f00a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Nov 25 2015 23:03:59 +0000 Subject: add __tls_get_new regression test --- 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