glibc/elf/tst-tlsmod18a.c
Ulrich Drepper 41e25904a5 * elf/dl-tls.c (__tls_get_addr): After calling _dl_update_slotinfo
refetch dtv, as it might have changed.
	* elf/Makefile: Add rules to build and run tst-tls18.
	* elf/tst-tls18.c: New test.
	* elf/tst-tlsmod18a.c: New file.
2008-10-31 20:50:16 +00:00

22 lines
322 B
C

#include <stdio.h>
#ifndef N
# define N 0
#endif
static __thread int var = 4;
int
test (void)
{
int *p = &var;
/* GCC assumes &var is never NULL, add optimization barrier. */
asm volatile ("" : "+r" (p));
if (p == NULL || *p != 4)
{
printf ("fail %d %p\n", N, p);
return 1;
}
return 0;
}