gcc/testsuite/g++.dg/tls/thread_local-wrap2.C
raw| 1 | // If we can't see the definition at the use site, but it's in this translation |
| 2 | // unit, we build a wrapper but don't bother with an init function. |
| 3 | |
| 4 | // { dg-do compile { target c++11 } } |
| 5 | // { dg-require-effective-target tls } |
| 6 | // { dg-final { scan-assembler "_ZTW1i" } } |
| 7 | // { dg-final { scan-assembler-not "_ZTH1i" } } |
| 8 | |
| 9 | extern thread_local int i; |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | return i - 42; |
| 14 | } |
| 15 | |
| 16 | thread_local int i = 42; |