| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-require-effective-target tls } |
| 3 |
|
| 4 |
// The variable should have a guard. |
| 5 |
// { dg-final { scan-assembler "_ZGVZ1fvE1a" } } |
| 6 |
// But since it's thread local we don't need to guard against |
| 7 |
// simultaneous execution. |
| 8 |
// { dg-final { scan-assembler-not "cxa_guard" } } |
| 9 |
// The guard should be TLS, not local common. |
| 10 |
// { dg-final { scan-assembler-not "\.comm" { xfail powerpc-*-aix* } } } |
| 11 |
|
| 12 |
struct A |
| 13 |
{ |
| 14 |
A(); |
| 15 |
}; |
| 16 |
|
| 17 |
A &f() |
| 18 |
{ |
| 19 |
thread_local A a; |
| 20 |
return a; |
| 21 |
} |