re-enable tls and lto tests for ObjC/C++
[official-gcc/alias-decl.git] / gcc / testsuite / objc.dg / torture / tls / thr-init-2.m
blob04231a82110b0c10e11ff7a07058911f97b18def
1 // { dg-do run }
2 // { dg-require-effective-target tls }
3 // { dg-add-options tls }
5 extern void _exit(int);
7 __thread int glb =1 ;
9 static __thread int fstat = 2;
11 int fa(int a)
13 static __thread int as = 3;
14   as += a ;
15   return as;
18 int fb(int b)
20 static __thread int bs = 4;
21   bs += b ;
22   glb = bs;
23   return bs;
26 int main (int ac, char *av[])
28   int a = 1;
29   
30   a = fa(fstat);
31   if ( a != 5 ) 
32     _exit (-(__LINE__)) ;
34   a = fa(glb);
35   if ( a != 6 ) 
36     _exit (-(__LINE__)) ;
38   a = fb(a);  
39   if ( a != 10 || glb != 10 ) 
40     _exit (-(__LINE__)) ;
41   
42   return 0;