gcc/testsuite/g++.dg/tls/pr102496-1.C
raw| 1 | // PR c++/102496 |
| 2 | // { dg-do link { target c++11 } } |
| 3 | // { dg-require-effective-target tls_link } |
| 4 | // { dg-add-options tls } |
| 5 | // { dg-additional-sources pr102496-2.C } |
| 6 | |
| 7 | template <int N> |
| 8 | int |
| 9 | foo () |
| 10 | { |
| 11 | extern __thread int t1; |
| 12 | return t1; |
| 13 | } |
| 14 | |
| 15 | int |
| 16 | main () |
| 17 | { |
| 18 | extern __thread int t2; |
| 19 | return foo <0> () + t2; |
| 20 | } |