gcc/testsuite/gcc.dg/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 void abort (void); |
| 6 | |
| 7 | static __thread int fstat ; |
| 8 | static __thread int fstat = 1; |
| 9 | |
| 10 | int test_code(int b) |
| 11 | { |
| 12 | fstat += b ; |
| 13 | return fstat; |
| 14 | } |
| 15 | |
| 16 | int main (int ac, char *av[]) |
| 17 | { |
| 18 | int a = test_code(1); |
| 19 | |
| 20 | if ((a != 2) || (fstat != 2)) |
| 21 | abort () ; |
| 22 | |
| 23 | return 0; |
| 24 | } |