Files
clang-p2996/lldb/test/Shell/SymbolFile/NativePDB/global-ctor-dtor.cpp
Jonas Devlieghere cf3464bbb7 [lldb] Set LLDB_USE_NATIVE_PDB_READER at the directory level (#114455)
Lit allows you to set environment variables for all tests in a directory
using a `lit.local.cfg` file. Do this for the PDB and NativePDB tests.
2024-10-31 15:31:51 -07:00

31 lines
815 B
C++

// clang-format off
// REQUIRES: lld, x86
// Global ctor and dtor should be globals decls.
// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -GS- -fno-addrsig -c /Fo%t.obj -- %s
// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb -force
// RUN: lldb-test symbols --dump-ast %t.exe | FileCheck %s
struct A {
~A() {};
};
struct B {
static A glob;
};
A B::glob = A();
int main() {
return 0;
}
// CHECK: static void B::`dynamic initializer for 'glob'();
// CHECK-NEXT: static void B::`dynamic atexit destructor for 'glob'();
// CHECK-NEXT: int main();
// CHECK-NEXT: static void _GLOBAL__sub_I_global_ctor_dtor.cpp();
// CHECK-NEXT: struct A {
// CHECK-NEXT: ~A();
// CHECK-NEXT: };
// CHECK-NEXT: struct B {
// CHECK-NEXT: static A glob;
// CHECK-NEXT: };