1 // PR c++/61343 2 3 // { dg-do run { target c++11 } } 4 // { dg-add-options tls } 5 // { dg-require-effective-target tls_runtime } 6 7 struct Foo { 8 int value; 9 FooFoo10 Foo() noexcept { 11 value = 12; 12 } 13 }; 14 15 static thread_local Foo a{}; 16 UseA()17static __attribute__((noinline)) void UseA() { 18 if (a.value != 12) __builtin_abort(); 19 } 20 main()21int main() { 22 UseA(); 23 } 24