repo.or.cz
/
uclibc-ng.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
linuxthreads: allow to choose on all supported architectures
[uclibc-ng.git]
/
test
/
tls
/
tst-tlsmod18a.c
blob
e0ae65a88cb2dbcde9bd1a25e66baa718b1bec5a
1
#include <stdio.h>
2
3
#ifndef N
4
# define N 0
5
#endif
6
7
static
__thread
int
var
=
4
;
8
9
int
10
test
(
void
)
11
{
12
int
*
p
= &
var
;
13
/* GCC assumes &var is never NULL, add optimization barrier. */
14
__asm__
__volatile__
(
""
:
"+r"
(
p
));
15
if
(
p
==
NULL
|| *
p
!=
4
)
16
{
17
printf
(
"fail %d %p
\n
"
,
N
,
p
);
18
return
1
;
19
}
20
return
0
;
21
}