repo.or.cz
/
official-gcc
/
graphite-test-results.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Merge from mainline (160224:163495).
[official-gcc/graphite-test-results.git]
/
gcc
/
testsuite
/
obj-c++.dg
/
torture
/
tls
/
thr-init-2.mm
blob
4e3f8e6e3d176857794effcef7f94227304b0e61
1
// { dg-do run }
2
// { dg-require-effective-target tls }
3
// { dg-add-options tls }
4
5
extern "C" {
6
extern void abort ();
7
}
8
9
__thread int glb =1 ;
10
11
static __thread int fstat = 2;
12
13
int fa(int a)
14
{
15
static __thread int as = 3;
16
as += a ;
17
return as;
18
}
19
20
int fb(int b)
21
{
22
static __thread int bs = 4;
23
bs += b ;
24
glb = bs;
25
return bs;
26
}
27
28
int main (int ac, char *av[])
29
{
30
int a = 1;
31
32
a = fa(fstat);
33
if ( a != 5 )
34
abort () ;
35
36
a = fa(glb);
37
if ( a != 6 )
38
abort () ;
39
40
a = fb(a);
41
if ( a != 10 || glb != 10 )
42
abort () ;
43
44
return 0;
45
}