repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR target/24475
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
tls
/
opt-11.c
blob
3739645257ab02e0fff6b4b3ebbbe33cbf6f0ead
1
/* { dg-do run } */
2
/* { dg-require-effective-target tls_runtime } */
3
4
extern
void
abort
(
void
);
5
extern
void
*
memset
(
void
*,
int
,
__SIZE_TYPE__
);
6
7
struct
A
8
{
9
char
pad
[
48
];
10
int
i
;
11
int
pad2
;
12
int
j
;
13
};
14
__thread
struct
A a
;
15
16
int
*
17
__attribute__
((
noinline
))
18
foo
(
void
)
19
{
20
return
&
a
.
i
;
21
}
22
23
int
24
main
(
void
)
25
{
26
int
*
p
=
foo
();
27
memset
(&
a
,
0
,
sizeof
(
a
));
28
a
.
i
=
6
;
29
a
.
j
=
8
;
30
if
(
p
[
0
] !=
6
||
p
[
1
] !=
0
||
p
[
2
] !=
8
)
31
abort
();
32
return
0
;
33
}