Debian Codegraph @

gcc/testsuite/g++.dg/tls/static-1.C

raw
1 // { dg-do run }
2 // { dg-options "-O2" }
3 // { dg-require-effective-target tls_runtime }
4 // { dg-add-options tls }
5 // { dg-additional-sources "static-1a.cc" }
6
7 extern "C" void abort ();
8 extern int test ();
9
10 struct A
11 {
12 static __thread int i;
13 };
14
15 __thread int A::i = 8;
16
17 int
18 main ()
19 {
20 if (A::i != 8)
21 abort ();
22
23 if (test ())
24 abort ();
25
26 if (A::i != 17)
27 abort ();
28
29 return 0;
30 }