Changeset View
Changeset View
Standalone View
Standalone View
test/MC/AMDGPU/hsa.s
// RUN: llvm-mc -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | FileCheck %s --check-prefix=ASM | // RUN: llvm-mc -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | FileCheck %s --check-prefix=ASM | ||||
// RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF | // RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF | ||||
// ELF: Section { | // ELF: Section { | ||||
// ELF: Name: .text | // ELF: Name: .text | ||||
// ELF: Type: SHT_PROGBITS (0x1) | // ELF: Type: SHT_PROGBITS (0x1) | ||||
// ELF: Flags [ (0x6) | // ELF: Flags [ (0x6) | ||||
// ELF: SHF_ALLOC (0x2) | // ELF: SHF_ALLOC (0x2) | ||||
// ELF: SHF_EXECINSTR (0x4) | // ELF: SHF_EXECINSTR (0x4) | ||||
// ELF: SHT_NOTE | // ELF: SHT_NOTE | ||||
// ELF: 0000: 04000000 08000000 01000000 414D4400 | // ELF: 0000: 04000000 08000000 01000000 414D4400 | ||||
// ELF: 0010: 02000000 00000000 04000000 1B000000 | // ELF: 0010: 02000000 00000000 04000000 1B000000 | ||||
// ELF: 0020: 03000000 414D4400 04000700 07000000 | // ELF: 0020: 03000000 414D4400 04000700 07000000 | ||||
// ELF: 0030: 00000000 00000000 414D4400 414D4447 | // ELF: 0030: 00000000 00000000 414D4400 414D4447 | ||||
// ELF: 0040: 50550000 | // ELF: 0040: 50550000 | ||||
// We can't check binary representation of metadata note: it is different on | |||||
// Windows and Linux because of carriage return on Windows | |||||
// ELF: Symbol { | // ELF: Symbol { | ||||
// ELF: Name: amd_kernel_code_t_minimal | // ELF: Name: amd_kernel_code_t_minimal | ||||
// ELF: Type: AMDGPU_HSA_KERNEL (0xA) | // ELF: Type: AMDGPU_HSA_KERNEL (0xA) | ||||
// ELF: Section: .text | // ELF: Section: .text | ||||
// ELF: } | // ELF: } | ||||
// ELF: Symbol { | // ELF: Symbol { | ||||
// ELF: Name: amd_kernel_code_t_test_all | // ELF: Name: amd_kernel_code_t_test_all | ||||
// ELF: Type: AMDGPU_HSA_KERNEL (0xA) | // ELF: Type: AMDGPU_HSA_KERNEL (0xA) | ||||
// ELF: Section: .text | // ELF: Section: .text | ||||
// ELF: } | // ELF: } | ||||
.text | .text | ||||
// ASM: .text | // ASM: .text | ||||
.hsa_code_object_version 2,0 | .hsa_code_object_version 2,0 | ||||
// ASM: .hsa_code_object_version 2,0 | // ASM: .hsa_code_object_version 2,0 | ||||
.hsa_code_object_isa 7,0,0,"AMD","AMDGPU" | .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" | ||||
// ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" | // ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" | ||||
.amdgpu_runtime_metadata | |||||
{ | |||||
amd.MDVersion: [ 2, 0 ] | |||||
amd.Kernels: [ | |||||
{ amd.KernelName: amd_kernel_code_t_test_all }, | |||||
{ amd.KernelName: amd_kernel_code_t_minimal } | |||||
] | |||||
} | |||||
.end_amdgpu_runtime_metadata | |||||
// ASM: .amdgpu_runtime_metadata | |||||
// ASM: { | |||||
// ASM: amd.MDVersion: [ 2, 0 ] | |||||
// ASM: amd.Kernels: [ | |||||
// ASM: { amd.KernelName: amd_kernel_code_t_test_all }, | |||||
// ASM: { amd.KernelName: amd_kernel_code_t_minimal } | |||||
// ASM: ] | |||||
// ASM: } | |||||
// ASM: .end_amdgpu_runtime_metadata | |||||
.amdgpu_hsa_kernel amd_kernel_code_t_test_all | .amdgpu_hsa_kernel amd_kernel_code_t_test_all | ||||
.amdgpu_hsa_kernel amd_kernel_code_t_minimal | .amdgpu_hsa_kernel amd_kernel_code_t_minimal | ||||
amd_kernel_code_t_test_all: | amd_kernel_code_t_test_all: | ||||
; Test all amd_kernel_code_t members with non-default values. | ; Test all amd_kernel_code_t members with non-default values. | ||||
.amd_kernel_code_t | .amd_kernel_code_t | ||||
kernel_code_version_major = 100 | kernel_code_version_major = 100 | ||||
kernel_code_version_minor = 100 | kernel_code_version_minor = 100 | ||||
machine_kind = 0 | machine_kind = 0 | ||||
machine_version_major = 5 | machine_version_major = 5 | ||||
machine_version_minor = 5 | machine_version_minor = 5 | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |