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
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
g++.dg
/
tls
/
thread_local2g.C
blob
8304a4d2f931e946773b2fd6c0a8ca2c6d1dfc0f
1
// { dg-do run { target c++11 } }
2
// { dg-add-options tls }
3
// { dg-require-effective-target tls_runtime }
4
5
extern "C" void abort();
6
7
struct A
8
{
9
A();
10
int i;
11
};
12
13
thread_local A a;
14
15
A &f()
16
{
17
return a;
18
}
19
20
int j;
21
A::A(): i(j) { }
22
23
int main()
24
{
25
j = 42;
26
if (f().i != 42)
27
abort ();
28
}