| 1 |
// PR c++/85400 |
| 2 |
// Testcase by Brian Vandenberg <[email protected]> |
| 3 |
|
| 4 |
// { dg-do link { target c++11 } } |
| 5 |
// { dg-require-effective-target fpic } |
| 6 |
// { dg-require-effective-target shared } |
| 7 |
// { dg-require-effective-target tls } |
| 8 |
// { dg-options "-shared -fPIC -O" } |
| 9 |
// { dg-add-options tls } |
| 10 |
|
| 11 |
struct Test |
| 12 |
{ |
| 13 |
int blah (int y) |
| 14 |
{ |
| 15 |
thread_local int mything = 3; |
| 16 |
mything = y > 0 ? y : mything; |
| 17 |
return mything; |
| 18 |
} |
| 19 |
}; |
| 20 |
|
| 21 |
int stuff (Test& test, int y) |
| 22 |
{ |
| 23 |
return test.blah(y); |
| 24 |
} |