mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 05:20:06 +00: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;
|
||
|
}
|