xref: /llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-zeroed-raw.s (revision 0c2e2f88fbd3f3ffa2e441e08cdd17141e7bea97)
1; RUN: llvm-mc %s --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -mattr=-xnack -filetype=obj -o %t1
2; RUN: llvm-objdump --disassemble-symbols=my_kernel.kd %t1 \
3; RUN: | tail -n +7 | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx908 -mattr=-xnack -filetype=obj -o %t2
4; RUN: llvm-objdump -s -j .text %t2 | FileCheck --check-prefix=OBJDUMP %s
5
6;; Not running lit-test over gfx10 (see kd-zeroed-gfx10.s for details).
7;; kd-zeroed-raw.s and kd-zeroed-*.s should produce the same output for the
8;; kernel descriptor - a block of 64 zeroed bytes.
9
10;; The disassembly will produce the contents of kd-zeroed-*.s which on being
11;; assembled contains additional relocation info. A diff over the entire object
12;; will fail in this case. So we check by looking the bytes in .text.
13
14; OBJDUMP:      0000 00000000 00000000 00000000 00000000
15; OBJDUMP-NEXT: 0010 00000000 00000000 00000000 00000000
16; OBJDUMP-NEXT: 0020 00000000 00000000 00000000 00000000
17; OBJDUMP-NEXT: 0030 00000000 00000000 00000000 00000000
18
19;; The entire object is zeroed out.
20
21.type	my_kernel.kd, @object
22.size my_kernel.kd, 64
23my_kernel.kd:
24  .long 0x00000000           ;; group_segment_fixed_size
25  .long 0x00000000           ;; private_segment_fixed_size
26  .quad 0x0000000000000000   ;; reserved bytes.
27  .quad 0x0000000000000000   ;; kernel_code_entry_byte_offset, any value works.
28
29  ;; 20 reserved bytes.
30  .quad 0x0000000000000000
31  .quad 0x0000000000000000
32  .long 0x00000000
33
34  .long 0x00000000           ;; compute_PGM_RSRC3
35  .long 0x00000000           ;; compute_PGM_RSRC1
36  .long 0x00000000           ;; compute_PGM_RSRC2
37  .short 0x0000              ;; additional fields.
38
39  ;; 6 reserved bytes.
40  .long 0x0000000
41  .short 0x0000
42