Index: llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test @@ -0,0 +1,337 @@ +# RUN: yaml2obj %s --docnum=1 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX600 + +# RUN: yaml2obj %s --docnum=2 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX601 + +# RUN: yaml2obj %s --docnum=3 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX700 + +# RUN: yaml2obj %s --docnum=4 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX701 + +# RUN: yaml2obj %s --docnum=5 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX702 + +# RUN: yaml2obj %s --docnum=6 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX703 + +# RUN: yaml2obj %s --docnum=7 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX704 + +# RUN: yaml2obj %s --docnum=8 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX801 + +# RUN: yaml2obj %s --docnum=9 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX802 + +# RUN: yaml2obj %s --docnum=10 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX803 + +# RUN: yaml2obj %s --docnum=11 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX810 + +# RUN: yaml2obj %s --docnum=12 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX900 + +# RUN: yaml2obj %s --docnum=13 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX902 + +# RUN: yaml2obj %s --docnum=14 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX904 + +# RUN: yaml2obj %s --docnum=15 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX906 + +# RUN: yaml2obj %s --docnum=16 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX908 + +# RUN: yaml2obj %s --docnum=17 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX909 + +# RUN: yaml2obj %s --docnum=18 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX1010 + +# RUN: yaml2obj %s --docnum=19 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX1011 + +# RUN: yaml2obj %s --docnum=20 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX1012 + +# RUN: yaml2obj %s --docnum=21 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX1030 + +# RUN: yaml2obj %s --docnum=22 -o %t +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t --check-prefixes=GCN,GFX1031 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX600 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX601 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX700 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX701 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX702 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX703 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX704 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX801 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX802 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX803 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX810 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX900 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX902 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX904 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX906 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX908 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX909 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1010 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1011 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1012 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1030 ] + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_AMDGPU_HSA + Type: ET_REL + Machine: EM_AMDGPU + Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1031 ] + +# GCN: File: [[FILE]] +# GCN-NEXT: Format: elf64-amdgpu +# GCN-NEXT: Arch: amdgcn +# GCN-NEXT: AddressSize: 64bit +# GCN-NEXT: LoadName: +# GCN-NEXT: ElfHeader { +# GCN-NEXT: Ident { +# GCN-NEXT: Magic: (7F 45 4C 46) +# GCN-NEXT: Class: 64-bit (0x2) +# GCN-NEXT: DataEncoding: LittleEndian (0x1) +# GCN-NEXT: FileVersion: 1 +# GCN-NEXT: OS/ABI: AMDGPU_HSA (0x40) +# GCN-NEXT: ABIVersion: 0 +# GCN-NEXT: Unused: (00 00 00 00 00 00 00) +# GCN-NEXT: } +# GCN-NEXT: Type: Relocatable (0x1) +# GCN-NEXT: Machine: EM_AMDGPU (0xE0) +# GCN-NEXT: Version: 1 +# GCN-NEXT: Entry: 0x0 +# GCN-NEXT: ProgramHeaderOffset: 0x0 +# GCN-NEXT: SectionHeaderOffset: 0x58 +# GFX600-NEXT: Flags [ (0x20) +# GFX600-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX600 (0x20) +# GFX601-NEXT: Flags [ (0x21) +# GFX601-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX601 (0x21) +# GFX700-NEXT: Flags [ (0x22) +# GFX700-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX700 (0x22) +# GFX701-NEXT: Flags [ (0x23) +# GFX701-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX701 (0x23) +# GFX702-NEXT: Flags [ (0x24) +# GFX702-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX702 (0x24) +# GFX703-NEXT: Flags [ (0x25) +# GFX703-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX703 (0x25) +# GFX704-NEXT: Flags [ (0x26) +# GFX704-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX704 (0x26) +# GFX801-NEXT: Flags [ (0x28) +# GFX801-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX801 (0x28) +# GFX802-NEXT: Flags [ (0x29) +# GFX802-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX802 (0x29) +# GFX803-NEXT: Flags [ (0x2A) +# GFX803-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX803 (0x2A) +# GFX810-NEXT: Flags [ (0x2B) +# GFX810-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX810 (0x2B) +# GFX900-NEXT: Flags [ (0x2C) +# GFX900-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX900 (0x2C) +# GFX902-NEXT: Flags [ (0x2D) +# GFX902-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX902 (0x2D) +# GFX904-NEXT: Flags [ (0x2E) +# GFX904-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX904 (0x2E) +# GFX906-NEXT: Flags [ (0x2F) +# GFX906-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX906 (0x2F) +# GFX908-NEXT: Flags [ (0x30) +# GFX908-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX908 (0x30) +# GFX909-NEXT: Flags [ (0x31) +# GFX909-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX909 (0x31) +# GFX1010-NEXT: Flags [ (0x33) +# GFX1010-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX1010 (0x33) +# GFX1011-NEXT: Flags [ (0x34) +# GFX1011-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX1011 (0x34) +# GFX1012-NEXT: Flags [ (0x35) +# GFX1012-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX1012 (0x35) +# GFX1030-NEXT: Flags [ (0x36) +# GFX1030-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX1030 (0x36) +# GFX1031-NEXT: Flags [ (0x37) +# GFX1031-NEXT: EF_AMDGPU_MACH_AMDGCN_GFX1031 (0x37) +# GCN-NEXT: ] +# GCN-NEXT: HeaderSize: 64 +# GCN-NEXT: ProgramHeaderEntrySize: 0 +# GCN-NEXT: ProgramHeaderCount: 0 +# GCN-NEXT: SectionHeaderEntrySize: 64 +# GCN-NEXT: SectionHeaderCount: 3 +# GCN-NEXT: StringTableSectionIndex: 2 +# GCN-NEXT: }