Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/pr84497.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 // PR 84497 mismatch with thread constructor fn weakness | |
2 // { dg-do compile { target c++11 } } | |
3 // { dg-require-weak "" } | |
4 | |
5 struct Base | |
6 { | |
7 int m; | |
8 | |
9 Base() noexcept = default; // trivial but not constexpr | |
10 ~Base() noexcept = default; | |
11 }; | |
12 | |
13 struct Derived : Base {}; | |
14 struct Container { | |
15 Base m; | |
16 }; | |
17 | |
18 #ifdef DEF | |
19 // This bit for exposition only. | |
20 // All items placed in .tbss | |
21 // __tls_init simply sets __tls_guard | |
22 // no aliases to __tls_init generated | |
23 thread_local Base base_obj; | |
24 thread_local Derived derived_obj; | |
25 thread_local Container container_obj; | |
26 #else | |
27 // Erroneously created strong undef refs to | |
28 // _ZTH11derived_obj, _ZTH13container_obj, _ZTH8base_obj | |
29 extern thread_local Base base_obj; | |
30 extern thread_local Derived derived_obj; | |
31 extern thread_local Container container_obj; | |
32 int main() { return !(&base_obj && &derived_obj && &container_obj);} | |
33 #endif | |
34 | |
35 // { dg-final { scan-assembler ".weak\[ \t\]*_ZTH8base_obj" } } | |
36 // { dg-final { scan-assembler ".weak\[ \t\]*_ZTH11derived_obj" } } | |
37 // { dg-final { scan-assembler ".weak\[ \t\]*_ZTH13container_obj" } } |