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
* g++.dg/tls/thread_local-order1.C: Add dg-require-cxa-atexit.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
tls
/
thread_local2g.C
blob
dd057c4dac0bacb038761a23e2fb3c6acb724d0b
1
// { dg-do run { xfail *-*-solaris2.9 } }
2
// { dg-options "-std=c++11" }
3
// { dg-require-effective-target tls_runtime }
4
// { dg-require-alias }
5
6
extern "C" void abort();
7
8
struct A
9
{
10
A();
11
int i;
12
};
13
14
thread_local A a;
15
16
A &f()
17
{
18
return a;
19
}
20
21
int j;
22
A::A(): i(j) { }
23
24
int main()
25
{
26
j = 42;
27
if (f().i != 42)
28
abort ();
29
}