re-enable tls and lto tests for ObjC/C++
[official-gcc/alias-decl.git] / gcc / testsuite / obj-c++.dg / torture / tls / thr-init-2.mm
blob4e3f8e6e3d176857794effcef7f94227304b0e61
1 // { dg-do run }
2 // { dg-require-effective-target tls }
3 // { dg-add-options tls }
5 extern "C" {
6 extern void abort ();
9 __thread int glb =1 ;
11 static __thread int fstat = 2;
13 int fa(int a)
15 static __thread int as = 3;
16   as += a ;
17   return as;
20 int fb(int b)
22 static __thread int bs = 4;
23   bs += b ;
24   glb = bs;
25   return bs;
28 int main (int ac, char *av[])
30   int a = 1;
31   
32   a = fa(fstat);
33   if ( a != 5 ) 
34     abort () ;
36   a = fa(glb);
37   if ( a != 6 ) 
38     abort () ;
40   a = fb(a);  
41   if ( a != 10 || glb != 10 ) 
42     abort () ;
43   
44   return 0;