56 lines · cpp
1// REQUIRES: lld2 3// RUN: %clangxx -g -c -o %t-1.o --target=x86_64-pc-linux -gno-pubnames %s4// RUN: %clangxx -g -c -o %t-2.o --target=x86_64-pc-linux -gno-pubnames %S/Inputs/find-variable-file-2.cpp5// RUN: ld.lld %t-1.o %t-2.o -o %t6// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \7// RUN: FileCheck --check-prefix=ONE %s8// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \9// RUN: FileCheck --check-prefix=TWO %s10 11// Run the same test with split-dwarf. This is interesting because the two12// split compile units will have the same offset (0).13// RUN: %clangxx -g -c -o %t-1.o --target=x86_64-pc-linux -gsplit-dwarf %s14// RUN: %clangxx -g -c -o %t-2.o --target=x86_64-pc-linux -gsplit-dwarf %S/Inputs/find-variable-file-2.cpp15// RUN: ld.lld %t-1.o %t-2.o -o %t16// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \17// RUN: FileCheck --check-prefix=ONE %s18// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \19// RUN: FileCheck --check-prefix=TWO %s20 21// RUN: %clangxx -c -o %t-1.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %s22// RUN: %clangxx -c -o %t-2.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %S/Inputs/find-variable-file-2.cpp23// RUN: ld.lld %t-1.o %t-2.o -o %t24// RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES25// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \26// RUN: FileCheck --check-prefix=ONE %s27// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \28// RUN: FileCheck --check-prefix=TWO %s29 30// Run the same test with split dwarf and pubnames to check whether we can find31// the compile unit using the name index if it is split.32// RUN: %clangxx -c -o %t-1.o --target=x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -gpubnames %s33// RUN: %clangxx -c -o %t-2.o --target=x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -gpubnames %S/Inputs/find-variable-file-2.cpp34// RUN: %clangxx -c -o %t-3.o --target=x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -gpubnames %S/Inputs/find-variable-file-3.cpp35// RUN: ld.lld %t-1.o %t-2.o %t-3.o -o %t36// RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES37// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \38// RUN: FileCheck --check-prefix=ONE %s39// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \40// RUN: FileCheck --check-prefix=TWO %s41// RUN: lldb-test symbols --file=find-variable-file-3.cpp --find=variable \42// RUN: --name=notexists %t43 44// NAMES: Name: .debug_names45 46// ONE: Found 1 variables:47namespace one {48int foo;49// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-file.cpp:[[@LINE-1]]50} // namespace one51 52extern "C" void _start() {}53 54// TWO: Found 1 variables:55// TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:256