OSDN Git Service

libjava:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / torture / tls / thr-init.m
1 /* { dg-do run } */
2 /* { dg-require-effective-target tls } */
3 /* { dg-add-options tls } */
4 /* { dg-skip-if "PR44140" { *-*-* } { "-flto" "-fwhopr" } { "" } } */
5
6 extern void _exit(int);
7
8 static __thread int fstat ;
9
10 static __thread int fstat = 1;
11
12 static __thread int fstat ;
13
14 int test_code(int b)
15 {
16   fstat += b ;
17   return fstat;
18 }
19
20 int main (int ac, char *av[])
21 {
22   int a = test_code(1);
23   
24   if ( a != 2 || fstat != 2 ) _exit (-(__LINE__)) ;
25   
26   return 0;
27 }