Partial implementation of C++11 thread_local.
[official-gcc.git] / gcc / testsuite / g++.dg / tls / thread_local1.C
blobe7734a0badf36ad1d2cbdb0cf2ea91309d9bb491
1 // { dg-options "-std=c++11" }
2 // { dg-require-effective-target tls }
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" } }
12 struct A
14   A();
17 A &f()
19   thread_local A a;
20   return a;