In gcc/: 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
[gcc.git] / gcc / testsuite / obj-c++.dg / tls / static-1.mm
1 // { dg-do run }
2 // { dg-require-effective-target tls }
3 // { dg-add-options tls }
4 // { dg-additional-sources "static-1a.mm" }
5
6 extern "C" {
7 extern void abort ();
8 }
9 extern int test ();
10
11 struct A
12 {
13 static __thread int i;
14 };
15
16 __thread int A::i = 8;
17
18 int
19 main ()
20 {
21 if (A::i != 8)
22 abort ();
23
24 if (test ())
25 abort ();
26
27 if (A::i != 17)
28 abort ();
29
30 return 0;
31 }