1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/tools/llvm-nm/defined-only.test
James Henderson fd5e264254 [llvm-nm][test] Add additional test coverage for llvm-nm options
Some of these options have a degree of incidental coverage, or are for
Mach-O only. This patch adds dedicated ELF (where applicable) coverage.

Differential Revision: https://reviews.llvm.org/D96602

Reviewed by: rupprecht, Higuoxing
2021-02-15 13:54:08 +00:00

28 lines
623 B
Plaintext

## Show that the --defined-only option omits undefined symbols.
# RUN: yaml2obj %s -o %t.o
# RUN: llvm-nm %t.o --defined-only > %t.defonly.txt
# RUN: llvm-nm %t.o -U > %t.U.txt
# RUN: cmp %t.defonly.txt %t.U.txt
# RUN: FileCheck %s --input-file=%t.defonly.txt --implicit-check-not={{.}}
# CHECK: 0000000000000000 T defined
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Symbols:
- Name: defined
Section: .text
Binding: STB_GLOBAL
- Name: undefined
Binding: STB_GLOBAL