gcc/testsuite/g++.dg/tls/static-1a.cc
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-O2" } |
| 3 | // { dg-require-effective-target tls_runtime } |
| 4 | // { dg-add-options tls } |
| 5 | // { dg-additional-sources "static-1a.cc" } |
| 6 | |
| 7 | struct A |
| 8 | { |
| 9 | static __thread int i; |
| 10 | }; |
| 11 | |
| 12 | int |
| 13 | test () |
| 14 | { |
| 15 | if (A::i != 8) |
| 16 | return 1; |
| 17 | |
| 18 | A::i = 17; |
| 19 | return 0; |
| 20 | } |