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>:
16 # CHECK: s_cbranch_execz L2
21 # I created this YAML starting with this LLVM IR:
23 # define void @break_cond_is_arg(i32 %arg, i1 %breakcond) {
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
32 # call void @llvm.amdgcn.raw.buffer.store.f32(float undef, <4 x i32> undef, i32 0, i32 undef, i32 0)
34 # endif: ; preds = %bb28, %bb
35 # br i1 %breakcond, label %loop, label %loopexit
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:
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)
65 Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1030 ]
69 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
71 Content: 00008CBF0000FDBB81020236810385BE800384BE8102847D6AC10689040082BF7E077E88058105817E047E8A080088BF0500887D7E060787070404886A3C87BEF7FF88BF000070E000000104F4FF82BF7E047E880000FDBB1E2080BE
72 - Name: .AMDGPU.config
75 Content: 48B80000000000004CB800000000000060B800000000000004000000000000000800000000000000
76 - Name: .note.GNU-stack
84 Desc: 616D6467636E2D756E6B6E6F776E2D6C696E75782D676E752D67667831303330
85 Type: NT_FREEBSD_PROCSTAT_GROUPS
86 - Type: SectionHeaderTable
91 - Name: .AMDGPU.config
92 - Name: .note.GNU-stack
96 - Name: break_cond_is_arg
103 #--- nonzero-secaddr.yml
110 Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1030 ]
114 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
117 Content: 00008CBF0000FDBB81020236810385BE800384BE8102847D6AC10689040082BF7E077E88058105817E047E8A080088BF0500887D7E060787070404886A3C87BEF7FF88BF000070E000000104F4FF82BF7E047E880000FDBB1E2080BE
118 - Name: .AMDGPU.config
122 Content: 48B80000000000004CB800000000000060B800000000000004000000000000000800000000000000
123 - Name: .note.GNU-stack
133 Desc: 616D6467636E2D756E6B6E6F776E2D6C696E75782D676E752D67667831303330
134 Type: NT_FREEBSD_PROCSTAT_GROUPS
135 - Type: SectionHeaderTable
140 - Name: .AMDGPU.config
141 - Name: .note.GNU-stack
145 - Name: break_cond_is_arg