Debian Codegraph @

gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c

raw
1 /* { dg-do run } */
2 /* { dg-require-effective-target tls_runtime } */
3 /* { dg-add-options tls } */
4
5 extern int printf (char *,...);
6 extern void abort() ;
7
8 static __thread int fstat ;
9 static __thread int fstat = 1;
10 static __thread int fstat ;
11
12 int test_code(int b)
13 {
14 fstat += b ;
15 return fstat;
16 }
17
18 int main (int ac, char *av[])
19 {
20 int a = test_code(1);
21
22 if ( a != 2 || fstat != 2 )
23 {
24 printf ("a=%d fstat=%d\n", a, fstat) ;
25 abort ();
26 }
27
28 return 0;
29 }