[llvm-readobj] - Simplify the symbols.test

We are able to use YAML macros to avoid having
4 independent YAML descriptions.

Differential revision: https://reviews.llvm.org/D82942
This commit is contained in:
Georgii Rymar 2020-07-01 12:58:20 +03:00
parent 65647ed1e5
commit 37dd8b6ce5
1 changed files with 6 additions and 48 deletions

View File

@ -10,17 +10,17 @@
## Case 1: Test how llvm-readobj and llvm-readelf dumps symbols.
## a) Check relocatable objects.
# RUN: yaml2obj %s --docnum=1 -o %t64
# RUN: yaml2obj %s -DBITS=64 -DTYPE=ET_REL -o %t64
# RUN: llvm-readobj --symbols %t64 | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-LLVM
# RUN: llvm-readelf --symbols %t64 | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-GNU64
# RUN: yaml2obj %s --docnum=2 -o %t32
# RUN: yaml2obj %s -DBITS=32 -DTYPE=ET_REL -o %t32
# RUN: llvm-readobj --symbols %t32 | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-LLVM
# RUN: llvm-readelf --symbols %t32 | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-GNU32
## b) Check dynamic objects.
# RUN: yaml2obj %s --docnum=3 -o %t64.so
# RUN: yaml2obj %s -DBITS=64 -DTYPE=ET_DYN -o %t64.so
# RUN: llvm-readobj --symbols %t64.so | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-LLVM
# RUN: llvm-readelf --symbols %t64.so | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-GNU64
# RUN: yaml2obj %s --docnum=4 -o %t32.so
# RUN: yaml2obj %s -DBITS=32 -DTYPE=ET_DYN -o %t32.so
# RUN: llvm-readobj --symbols %t32.so | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-LLVM
# RUN: llvm-readelf --symbols %t32.so | FileCheck %s --match-full-lines --strict-whitespace --check-prefix=SYMBOLS-GNU32
@ -105,9 +105,9 @@
--- !ELF
FileHeader:
Class: ELFCLASS64
Class: ELFCLASS[[BITS]]
Data: ELFDATA2LSB
Type: ET_REL
Type: [[TYPE]]
Machine: EM_X86_64
Symbols:
- Name: foo
@ -116,45 +116,3 @@ Symbols:
Value: 0x2
DynamicSymbols:
- Name: zed
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_386
Symbols:
- Name: foo
Value: 0x1
- Name: bar
Value: 0x2
DynamicSymbols:
- Name: zed
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_X86_64
Symbols:
- Name: foo
Value: 0x1
- Name: bar
Value: 0x2
DynamicSymbols:
- Name: zed
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_386
Symbols:
- Name: foo
Value: 0x1
- Name: bar
Value: 0x2
DynamicSymbols:
- Name: zed