diff --git a/llvm/test/tools/llvm-nm/debug-syms.test b/llvm/test/tools/llvm-nm/debug-syms.test --- a/llvm/test/tools/llvm-nm/debug-syms.test +++ b/llvm/test/tools/llvm-nm/debug-syms.test @@ -1,6 +1,6 @@ -# RUN: yaml2obj %s -o %t.o -# RUN: llvm-nm --debug-syms %t.o | FileCheck %s --implicit-check-not U -# RUN: llvm-nm -a %t.o | FileCheck %s --implicit-check-not U +# RUN: yaml2obj --docnum=1 %s -o %t1.o +# RUN: llvm-nm --debug-syms %t1.o | FileCheck %s --implicit-check-not U --check-prefix SYMBOL +# RUN: llvm-nm -a %t1.o | FileCheck %s --implicit-check-not U --check-prefix SYMBOL !ELF FileHeader: @@ -25,8 +25,35 @@ - Name: $a Section: section -# CHECK: $a -# CHECK-NEXT: $d -# CHECK-NEXT: $t -# CHECK-NEXT: file_sym -# CHECK-NEXT: section +# SYMBOL: $a +# SYMBOL-NEXT: $d +# SYMBOL-NEXT: $t +# SYMBOL-NEXT: file_sym +# SYMBOL-NEXT: section + +# RUN: yaml2obj --docnum=2 %s -o %t2.o +# RUN: llvm-nm --debug-syms --dynamic %t2.o | FileCheck %s --implicit-check-not U --check-prefix DYNSYM +# RUN: llvm-nm -a --dynamic %t2.o | FileCheck %s --implicit-check-not U --check-prefix DYNSYM + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 +Sections: + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_WRITE ] +DynamicSymbols: + - Name: dynglobal + Type: STT_OBJECT + Binding: STB_GLOBAL + Section: .data + - Name: dynlocal + Type: STT_OBJECT + Binding: STB_LOCAL + Section: .data + +# DYNSYM: dynglobal +# DYNSYM-NEXT: dynlocal