These tests used "clang -mllvm -accel-tables=Dwarf" as a way to guarantee that clang will emit the debug_names table. Unfortunately, a change it clang made that insufficient (-gpubnames is required now too), which rendered these tests ineffective. Since lldb automatically falls back to the manual index, the tests didn't fail and this change went largely unnoticed. This patch updates the tests to really use debug_names (-gdwarf-5 -gpubnames) is the combination that works now, and it adds additional checks to ensure the section is actually emitted. Fortunately, no regressions crept in while these tests were disabled.
27 lines
826 B
C++
27 lines
826 B
C++
// Test that we return complete results when only a part of the binary is built
|
|
// with an index.
|
|
|
|
// REQUIRES: lld
|
|
|
|
// RUN: %clang %s -c -o %t-1.o --target=x86_64-pc-linux -DONE -gdwarf-5 -gpubnames
|
|
// RUN: llvm-readobj --sections %t-1.o | FileCheck %s --check-prefix NAMES
|
|
// RUN: %clang %s -c -o %t-2.o --target=x86_64-pc-linux -DTWO -gdwarf-5 -gno-pubnames
|
|
// RUN: ld.lld %t-1.o %t-2.o -o %t
|
|
// RUN: lldb-test symbols --find=variable --name=foo %t | FileCheck %s
|
|
|
|
// NAMES: Name: .debug_names
|
|
|
|
// CHECK: Found 2 variables:
|
|
#ifdef ONE
|
|
namespace one {
|
|
int foo;
|
|
// CHECK-DAG: name = "foo", {{.*}} decl = dwarf5-partial-index.cpp:[[@LINE-1]]
|
|
} // namespace one
|
|
extern "C" void _start() {}
|
|
#else
|
|
namespace two {
|
|
int foo;
|
|
// CHECK-DAG: name = "foo", {{.*}} decl = dwarf5-partial-index.cpp:[[@LINE-1]]
|
|
} // namespace two
|
|
#endif
|