[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / tools / llvm-objdump / X86 / elf-bbaddrmap-symbolize-relocatable.yaml
blobd5a618467bd2c9973181504ec6a1eee28c6295bb
1 ## Test that in the presence of SHT_LLVM_BB_ADDR_MAP sections,
2 ## --symbolize-operands can display <BB*> labels properly in a relocatable
3 ## object file.
5 ## Fails on windows (https://github.com/llvm/llvm-project/issues/60013).
6 # UNSUPPORTED: system-windows
8 ## Relocatable Object file.
9 # RUN: yaml2obj %s -o %t1
10 # RUN: llvm-objdump %t1 -d --symbolize-operands -M att --no-show-raw-insn --no-leading-addr | \
11 # RUN:   FileCheck %s -DSYM=symbol --match-full-lines
13 --- !ELF
14 FileHeader:
15   Class:           ELFCLASS64
16   Data:            ELFDATA2LSB
17   Type:            ET_REL
18   Machine:         EM_X86_64
19   SectionHeaderStringTable: .strtab
20 Sections:
21   - Name:    .text
22     Type:    SHT_PROGBITS
23     Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
24     Content: FFFF
25   - Name:    .llvm_bb_addr_map
26     Type:    SHT_LLVM_BB_ADDR_MAP
27     Link:    .text
28     Entries:
29       - Version: 2
30         BBEntries:
31           - ID:              0
32             AddressOffset:   0x0
33             Size:            0x1
34             Metadata:        0x1
35       - Version: 2
36         BBEntries:
37           - ID:              0
38             AddressOffset:   0x0
39             Size:            0x1
40             Metadata:        0x1
41   - Name:  .rela.llvm_bb_addr_map
42     Type:  SHT_RELA
43     Flags: [ SHF_INFO_LINK ]
44     Link:  .symtab
45     Info:  .llvm_bb_addr_map
46     Relocations:
47       - Offset: 0x2
48         Symbol: .text
49         Type:   R_X86_64_64
50       - Offset: 0x11
51         Symbol: .text
52         Type:   R_X86_64_64
53         Addend: 1
54 Symbols:
55   - Name:    a
56     Section: .text
57     Value:   0x0
58   - Name:    c
59     Section: .text
60     Value:   0x1
61   - Name:    .text
62     Type:    STT_SECTION
63     Section: .text
65 # CHECK:      <a>:
66 # CHECK-NEXT: <BB0>:
67 # CHECK:      <c>:
68 # CHECK-NEXT: <BB0>:
70 ## Check that if we're missing a relocation section we get the appropriate
71 ## warning.
73 # RUN: yaml2obj %s --docnum=2 -o %t2
74 # RUN: llvm-readobj %t2 --bb-addr-map 2>&1 | FileCheck %s --check-prefix=NO-RELA-SECTION -DFILE=%t2
76 --- !ELF
77 FileHeader:
78   Class:           ELFCLASS64
79   Data:            ELFDATA2LSB
80   Type:            ET_REL
81   Machine:         EM_X86_64
82 Sections:
83   - Name:    .text
84     Type:    SHT_PROGBITS
85     Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
86     Content: FF
87   - Name:    .llvm_bb_addr_map
88     Type:    SHT_LLVM_BB_ADDR_MAP
89     Link:    .text
91 # NO-RELA-SECTION: warning: '[[FILE]]': unable to get relocation section for SHT_LLVM_BB_ADDR_MAP section with index 2