[llvm-nm] - Fix a bug and unbreak ASan BB.
[llvm-complete.git] / test / Object / nm-shared-object.test
blob6358295e654e05d47be9c58f2de6e7f7c81a8a48
1 # RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-i386 \
2 # RUN:         | FileCheck %s -check-prefix ELF-32
4 # ELF-32-NOT: U
5 # ELF-32: 000012c8 A __bss_start
6 # ELF-32: 000012c8 A _edata
7 # ELF-32: 000012cc A _end
8 # ELF-32: 000012c8 B common_sym
9 # ELF-32: 000012c4 D defined_sym
10 # ELF-32: 000001f0 T global_func
11 # ELF-32: 00000000 D tls_sym
13 # RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-x86-64 \
14 # RUN:         | FileCheck %s -check-prefix ELF-64
16 # ELF-64-NOT: U
17 # ELF-64: 0000000000200454 A __bss_start
18 # ELF-64: 0000000000200454 A _edata
19 # ELF-64: 0000000000200458 A _end
20 # ELF-64: 0000000000200454 B common_sym
21 # ELF-64: 0000000000200450 D defined_sym
22 # ELF-64: 00000000000002f0 T global_func
23 # ELF-64: 0000000000000000 D tls_sym
25 # RUN: not llvm-nm -D %p/Inputs/weak-global-symbol.macho-i386 2>&1 \
26 # RUN:         | FileCheck %s -check-prefix ERROR
28 # RUN: not llvm-nm -D %p/Inputs/trivial-object-test.coff-i386 2>&1 \
29 # RUN:         | FileCheck %s -check-prefix ERROR
31 # ERROR: File format has no dynamic symbol table.
33 # RUN: yaml2obj %s > %t.elf-i386
34 # RUN: llvm-nm -D %t.elf-i386 2>&1 | FileCheck %s -check-prefix=NO-SYMBOLS
36 # NO-SYMBOLS: no symbols
38 --- !ELF
39 FileHeader:
40   Class:   ELFCLASS32
41   Data:    ELFDATA2LSB
42   Type:    ET_REL
43   Machine: EM_386
44 Symbols:
45   - Name:    foo
46     Binding: STB_GLOBAL