mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-15 04:20:28 +08:00
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;
|
||
|
}
|