[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / tools / llvm-objdump / AMDGPU / elf-disassemble-symbolize-operands.yaml
blob194f51a0a7402d3d15760fca35524f8398bc4995
1 # RUN: rm -rf %t
2 # RUN: %split-file %s %t
4 # RUN: yaml2obj %t/zero-secaddr.yml -o %t/zero-secaddr
5 # RUN: llvm-objdump %t/zero-secaddr -d --symbolize-operands\
6 # RUN:  --no-show-raw-insn --no-leading-addr | FileCheck %s
8 # RUN: yaml2obj %t/nonzero-secaddr.yml -o %t/nonzero-secaddr
9 # RUN: llvm-objdump %t/nonzero-secaddr -d --symbolize-operands\
10 # RUN:  --no-show-raw-insn --no-leading-addr | FileCheck %s
12 ## Expect to find the branch labels.
13 # CHECK: <break_cond_is_arg>:
14 # CHECK:     s_branch L1
15 # CHECK: <L0>:
16 # CHECK:     s_cbranch_execz L2
17 # CHECK: <L1>:
18 # CHECK:     s_branch L0
19 # CHECKL <L2>:
21 # I created this YAML starting with this LLVM IR:
23 #   define void @break_cond_is_arg(i32 %arg, i1 %breakcond) {
24 #   entry:
25 #     br label %loop
26 #   loop:
27 #     %tmp23phi = phi i32 [ %tmp23, %endif ], [ 0, %entry ]
28 #     %tmp23 = add nuw i32 %tmp23phi, 1
29 #     %tmp27 = icmp ult i32 %arg, %tmp23
30 #     br i1 %tmp27, label %then, label %endif
31 #   then:                                             ; preds = %bb
32 #     call void @llvm.amdgcn.raw.buffer.store.f32(float undef, <4 x i32> undef, i32 0, i32 undef, i32 0)
33 #     br label %endif
34 #   endif:                                             ; preds = %bb28, %bb
35 #     br i1 %breakcond, label %loop, label %loopexit
36 #   loopexit:
37 #     ret void
38 #   }
40 #   declare void @llvm.amdgcn.raw.buffer.store.f32(float, <4 x i32>, i32, i32, i32 immarg) #0
42 #   attributes #0 = { nounwind writeonly }
44 # I compiled it to a relocatable ELF:
46 #   llc -march=amdgcn -mcpu=gfx1030 llvm/a.ll -filetype=obj -o a.elf
48 # then converted it to YAML:
50 #   obj2yaml a.elf
52 # then manually removed the BB0_1 etc local symbols.
54 # Note that there are two copies of the file:
55 #   - One as a relocatable object file (zero section addresses)
56 #   - One as a shared object file (non-zero section addresses)
58 #--- zero-secaddr.yml
59 --- !ELF
60 FileHeader:
61   Class:           ELFCLASS64
62   Data:            ELFDATA2LSB
63   Type:            ET_REL
64   Machine:         EM_AMDGPU
65   Flags:           [ EF_AMDGPU_MACH_AMDGCN_GFX1030 ]
66 Sections:
67   - Name:            .text
68     Type:            SHT_PROGBITS
69     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
70     AddressAlign:    0x4
71     Content:         00008CBF0000FDBB81020236810385BE800384BE8102847D6AC10689040082BF7E077E88058105817E047E8A080088BF0500887D7E060787070404886A3C87BEF7FF88BF000070E000000104F4FF82BF7E047E880000FDBB1E2080BE
72   - Name:            .AMDGPU.config
73     Type:            SHT_PROGBITS
74     AddressAlign:    0x1
75     Content:         48B80000000000004CB800000000000060B800000000000004000000000000000800000000000000
76   - Name:            .note.GNU-stack
77     Type:            SHT_PROGBITS
78     AddressAlign:    0x1
79   - Name:            .note
80     Type:            SHT_NOTE
81     AddressAlign:    0x4
82     Notes:
83       - Name:            AMD
84         Desc:            616D6467636E2D756E6B6E6F776E2D6C696E75782D676E752D67667831303330
85         Type:            NT_FREEBSD_PROCSTAT_GROUPS
86   - Type:            SectionHeaderTable
87     Sections:
88       - Name:            .strtab
89       - Name:            .shstrtab
90       - Name:            .text
91       - Name:            .AMDGPU.config
92       - Name:            .note.GNU-stack
93       - Name:            .note
94       - Name:            .symtab
95 Symbols:
96   - Name:            break_cond_is_arg
97     Type:            STT_FUNC
98     Section:         .text
99     Binding:         STB_GLOBAL
100     Size:            0x5C
103 #--- nonzero-secaddr.yml
104 --- !ELF
105 FileHeader:
106   Class:           ELFCLASS64
107   Data:            ELFDATA2LSB
108   Type:            ET_DYN
109   Machine:         EM_AMDGPU
110   Flags:           [ EF_AMDGPU_MACH_AMDGCN_GFX1030 ]
111 Sections:
112   - Name:            .text
113     Type:            SHT_PROGBITS
114     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
115     Address:         0x1000
116     AddressAlign:    0x4
117     Content:         00008CBF0000FDBB81020236810385BE800384BE8102847D6AC10689040082BF7E077E88058105817E047E8A080088BF0500887D7E060787070404886A3C87BEF7FF88BF000070E000000104F4FF82BF7E047E880000FDBB1E2080BE
118   - Name:            .AMDGPU.config
119     Type:            SHT_PROGBITS
120     Address:         0x2000
121     AddressAlign:    0x1
122     Content:         48B80000000000004CB800000000000060B800000000000004000000000000000800000000000000
123   - Name:            .note.GNU-stack
124     Type:            SHT_PROGBITS
125     Address:         0x3000
126     AddressAlign:    0x1
127   - Name:            .note
128     Type:            SHT_NOTE
129     Address:         0x4000
130     AddressAlign:    0x4
131     Notes:
132       - Name:            AMD
133         Desc:            616D6467636E2D756E6B6E6F776E2D6C696E75782D676E752D67667831303330
134         Type:            NT_FREEBSD_PROCSTAT_GROUPS
135   - Type:            SectionHeaderTable
136     Sections:
137       - Name:            .strtab
138       - Name:            .shstrtab
139       - Name:            .text
140       - Name:            .AMDGPU.config
141       - Name:            .note.GNU-stack
142       - Name:            .note
143       - Name:            .symtab
144 Symbols:
145   - Name:            break_cond_is_arg
146     Type:            STT_FUNC
147     Section:         .text
148     Binding:         STB_GLOBAL
149     Size:            0x5C
150     Value:           0x1000