1 // REQUIRES: lld 2 3 // RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -gno-pubnames %s 4 // RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -gno-pubnames %S/Inputs/find-variable-file-2.cpp 5 // RUN: ld.lld %t-1.o %t-2.o -o %t 6 // RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \ 7 // RUN: FileCheck --check-prefix=ONE %s 8 // RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \ 9 // RUN: FileCheck --check-prefix=TWO %s 10 11 // Run the same test with split-dwarf. This is interesting because the two 12 // split compile units will have the same offset (0). 13 // RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -gsplit-dwarf %s 14 // RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -gsplit-dwarf %S/Inputs/find-variable-file-2.cpp 15 // RUN: ld.lld %t-1.o %t-2.o -o %t 16 // RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \ 17 // RUN: FileCheck --check-prefix=ONE %s 18 // RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \ 19 // RUN: FileCheck --check-prefix=TWO %s 20 21 // RUN: %clang -c -o %t-1.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %s 22 // RUN: %clang -c -o %t-2.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %S/Inputs/find-variable-file-2.cpp 23 // RUN: ld.lld %t-1.o %t-2.o -o %t 24 // RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES 25 // RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \ 26 // RUN: FileCheck --check-prefix=ONE %s 27 // RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \ 28 // RUN: FileCheck --check-prefix=TWO %s 29 30 // NAMES: Name: .debug_names 31 32 // ONE: Found 1 variables: 33 namespace one { 34 int foo; 35 // ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-file.cpp:[[@LINE-1]] 36 } // namespace one 37 38 extern "C" void _start() {} 39 40 // TWO: Found 1 variables: 41 // TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:2 42