mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 19:53:32 +08:00
41e25904a5
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.
22 lines
322 B
C
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;
|
|
}
|