xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-names-compressed.cpp (revision 8a64d80a959bf2844df33f9112e456f33de7b468)
1 // Test for a bug where we crashed while processing a compressed debug_names
2 // section (use after free).
3 
4 // REQUIRES: lld, zlib
5 
6 // RUN: %clang -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %s
7 // RUN: ld.lld %t.o -o %t --compress-debug-sections=zlib
8 // RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
9 // RUN: lldb-test symbols --find=variable --name=foo %t | FileCheck %s
10 
11 // NAMES: Name: .debug_names
12 
13 // CHECK: Found 1 variables:
14 int foo;
15 // CHECK-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = debug-names-compressed.cpp:[[@LINE-1]]
16 
_start()17 extern "C" void _start() {}
18