1## This is a test for --headers and its alias -e.
2## Specifying --headers is equivalent to setting --file-headers,
3## --program-headers and --section-headers at the same time.
4## We test these options independently, so here we just check
5## that --headers triggers them.
6
7# RUN: yaml2obj %s -o %t
8
9## Case A: test llvm-readelf output.
10# RUN: llvm-readelf --headers %t > %t.headers.gnu.txt
11# RUN: FileCheck %s --input-file=%t.headers.gnu.txt --check-prefix=GNU
12
13# GNU: ELF Header:
14# GNU: Section Headers:
15# GNU: Program Headers:
16# GNU: Section to Segment mapping:
17
18# RUN: llvm-readelf -e %t > %t.e.gnu.txt
19# RUN: cmp %t.headers.gnu.txt %t.e.gnu.txt
20
21# RUN: llvm-readelf --file-headers --program-headers --section-headers %t > %t.all.gnu.txt
22# RUN: cmp %t.headers.gnu.txt %t.all.gnu.txt
23
24## Case B: test llvm-readobj output.
25# RUN: llvm-readobj --headers %t > %t.headers.llvm.txt
26# RUN: FileCheck %s --input-file=%t.headers.llvm.txt --check-prefix=LLVM
27
28# LLVM: ElfHeader {
29# LLVM: Sections [
30# LLVM: ProgramHeaders [
31
32# RUN: llvm-readobj -e %t > %t.e.llvm.txt
33# RUN: cmp %t.headers.llvm.txt %t.e.llvm.txt
34
35# RUN: llvm-readobj --file-headers --program-headers --section-headers %t > %t.all.llvm.txt
36# RUN: cmp %t.headers.llvm.txt %t.all.llvm.txt
37
38--- !ELF
39FileHeader:
40  Class: ELFCLASS64
41  Data:  ELFDATA2LSB
42  Type:  ET_REL
43Sections:
44  - Name: .foo
45    Type: SHT_PROGBITS
46ProgramHeaders:
47  - Type: PT_LOAD
48