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
Partial implementation of C++11 thread_local.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
tls
/
thread_local2.C
blob
4cbef155ead855eb5d8a7880e1f378ffeb7a63bf
1
// { dg-do run }
2
// { dg-options "-std=c++11" }
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
A &f()
14
{
15
thread_local A a;
16
return a;
17
}
18
19
int j;
20
A::A(): i(j) { }
21
22
int main()
23
{
24
j = 42;
25
if (f().i != 42)
26
abort ();
27
}