1 | // clang-format off |
2 | // REQUIRES: lld, x86 |
3 | |
4 | // Global ctor and dtor should be globals decls. |
5 | // RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -GS- -fno-addrsig -c /Fo%t.obj -- %s |
6 | // RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb -force |
7 | // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols --dump-ast %t.exe | FileCheck %s |
8 | |
9 | struct A { |
10 | ~A() {}; |
11 | }; |
12 | struct B { |
13 | static A glob; |
14 | }; |
15 | |
16 | A B::glob = A(); |
17 | int main() { |
18 | return 0; |
19 | } |
20 | |
21 | // CHECK: static void B::`dynamic initializer for 'glob'(); |
22 | // CHECK-NEXT: static void B::`dynamic atexit destructor for 'glob'(); |
23 | // CHECK-NEXT: int main(); |
24 | // CHECK-NEXT: static void _GLOBAL__sub_I_global_ctor_dtor.cpp(); |
25 | // CHECK-NEXT: struct A { |
26 | // CHECK-NEXT: ~A(); |
27 | // CHECK-NEXT: }; |
28 | // CHECK-NEXT: struct B { |
29 | // CHECK-NEXT: static A glob; |
30 | // CHECK-NEXT: }; |
31 | |