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.
42 lines
1.9 KiB
C++
42 lines
1.9 KiB
C++
// REQUIRES: lld
|
|
|
|
// RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -gno-pubnames %s
|
|
// RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -gno-pubnames %S/Inputs/find-variable-file-2.cpp
|
|
// RUN: ld.lld %t-1.o %t-2.o -o %t
|
|
// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=ONE %s
|
|
// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=TWO %s
|
|
|
|
// Run the same test with split-dwarf. This is interesting because the two
|
|
// split compile units will have the same offset (0).
|
|
// RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -gsplit-dwarf %s
|
|
// RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -gsplit-dwarf %S/Inputs/find-variable-file-2.cpp
|
|
// RUN: ld.lld %t-1.o %t-2.o -o %t
|
|
// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=ONE %s
|
|
// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=TWO %s
|
|
|
|
// RUN: %clang -c -o %t-1.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %s
|
|
// RUN: %clang -c -o %t-2.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %S/Inputs/find-variable-file-2.cpp
|
|
// RUN: ld.lld %t-1.o %t-2.o -o %t
|
|
// RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
|
|
// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=ONE %s
|
|
// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
|
|
// RUN: FileCheck --check-prefix=TWO %s
|
|
|
|
// NAMES: Name: .debug_names
|
|
|
|
// ONE: Found 1 variables:
|
|
namespace one {
|
|
int foo;
|
|
// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-file.cpp:[[@LINE-1]]
|
|
} // namespace one
|
|
|
|
extern "C" void _start() {}
|
|
|
|
// TWO: Found 1 variables:
|
|
// TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:2
|