1 ## Test that --section works correctly for -h.
2 ## We test the LMA here too, because the code at the time of writing uses the
3 ## value of --section when looking up section LMAs.
4 # RUN: yaml2obj %s --docnum=1 -o %t.h.elf
5 # RUN: llvm-objdump -h %t.h.elf -j=.text --section=.bss \
6 # RUN: | FileCheck %s --check-prefix=SHDRS --implicit-check-not=.data --implicit-check-not=.text2
8 # SHDRS: Name Size VMA LMA
9 # SHDRS: .text 00000001 0000000000000400 0000000000001000
10 # SHDRS: .bss 00000001 0000000000000420 0000000000003000
21 Flags: [SHF_ALLOC, SHF_EXECINSTR]
27 Flags: [SHF_ALLOC, SHF_EXECINSTR]
32 Flags: [SHF_ALLOC, SHF_WRITE]
38 Flags: [SHF_ALLOC, SHF_WRITE]
60 ## Test that --section works with --fault-map-section.
61 # RUN: yaml2obj %s --docnum=2 -o %t.o
62 # RUN: llvm-objdump %t.o --fault-map-section -j __clangast \
63 # RUN: | FileCheck %s --check-prefixes=FAULTMAP,NO-FAULTMAP
64 # RUN: llvm-objdump %t.o --fault-map-section -j .llvm_faultmaps \
65 # RUN: | FileCheck %s --check-prefixes=FAULTMAP,WITH-FAULTMAP
67 # FAULTMAP: FaultMap table:
68 # NO-FAULTMAP-NEXT: <not found>
69 # WITH-FAULTMAP-NEXT: Version: 0x1
70 # WITH-FAULTMAP-NEXT: NumFunctions: 0
72 ## Test that --section works with --raw-clang-ast.
73 # RUN: llvm-objdump %t.o --raw-clang-ast -j .llvm_faultmaps \
74 # RUN: | FileCheck %s --check-prefix=NO-AST --allow-empty
75 # RUN: llvm-objdump %t.o --raw-clang-ast -j __clangast \
76 # RUN: | FileCheck %s --check-prefix=CLANG-AST
88 - Name: .llvm_faultmaps
90 Content: '0100000000000000'
93 Content: '666f6f626172' # "foobar"
95 ## Test that the -j alias can be used flexibly. Create a baseline and ensure
96 ## all other combinations are identical.
97 # RUN: llvm-objdump %t.h.elf -h -s --section .symtab > %t.full
98 # RUN: llvm-objdump %t.h.elf -h -s -j .symtab > %t.1
99 # RUN: llvm-objdump %t.h.elf -h -s -j=.symtab > %t.2
100 # RUN: llvm-objdump %t.h.elf -h -s -j.symtab > %t.3
101 # RUN: llvm-objdump %t.h.elf -hsj .symtab > %t.4
102 # RUN: llvm-objdump %t.h.elf -hsj=.symtab > %t.5
103 # RUN: llvm-objdump %t.h.elf -hsj.symtab > %t.6
105 # RUN: cmp %t.full %t.1
106 # RUN: cmp %t.full %t.2
107 # RUN: cmp %t.full %t.3
108 # RUN: cmp %t.full %t.4
109 # RUN: cmp %t.full %t.5
110 # RUN: cmp %t.full %t.6
112 ## Test that an unknown section name causes all section output to be suppressed.
113 # RUN: llvm-objdump %t.h.elf -h --section foobar \
114 # RUN: | FileCheck %s --check-prefix=NO-SECTION
116 # NO-SECTION: Sections:
117 # NO-SECTION-NEXT: Idx Name Size VMA Type
118 # NO-SECTION-NOT: {{.}}