diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/AMDGPU/hsa.ll | 13 | ||||
| -rw-r--r-- | llvm/test/MC/AMDGPU/hsa-text.s | 34 | ||||
| -rw-r--r-- | llvm/test/MC/AMDGPU/hsa.s | 15 |
3 files changed, 61 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/hsa.ll b/llvm/test/CodeGen/AMDGPU/hsa.ll index 653a6bb1b60..5c749829381 100644 --- a/llvm/test/CodeGen/AMDGPU/hsa.ll +++ b/llvm/test/CodeGen/AMDGPU/hsa.ll @@ -6,6 +6,17 @@ ; The SHT_NOTE section contains the output from the .hsa_code_object_* ; directives. +; ELF: Section { +; ELF: Name: .hsatext +; ELF: Type: SHT_PROGBITS (0x1) +; ELF: Flags [ (0xC00007) +; ELF: SHF_ALLOC (0x2) +; ELF: SHF_AMDGPU_HSA_AGENT (0x800000) +; ELF: SHF_AMDGPU_HSA_CODE (0x400000) +; ELF: SHF_EXECINSTR (0x4) +; ELF: SHF_WRITE (0x1) +; ELF: } + ; ELF: SHT_NOTE ; ELF: 0000: 04000000 08000000 01000000 414D4400 ; ELF: 0010: 01000000 00000000 04000000 1B000000 @@ -17,6 +28,8 @@ ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU" +; HSA: .hsatext + ; HSA: {{^}}simple: ; HSA: .amd_kernel_code_t ; HSA: .end_amd_kernel_code_t diff --git a/llvm/test/MC/AMDGPU/hsa-text.s b/llvm/test/MC/AMDGPU/hsa-text.s new file mode 100644 index 00000000000..1d2f1f1619e --- /dev/null +++ b/llvm/test/MC/AMDGPU/hsa-text.s @@ -0,0 +1,34 @@ +// 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 -s -sd | FileCheck %s --check-prefix=ELF + +// For compatibility reasons we treat convert .text sections to .hsatext + +// ELF: Section { + +// We want to avoid emitting an empty .text section. +// ELF-NOT: Name: .text + +// ELF: Name: .hsatext +// ELF: Type: SHT_PROGBITS (0x1) +// ELF: Flags [ (0xC00007) +// ELF: SHF_ALLOC (0x2) +// ELF: SHF_AMDGPU_HSA_AGENT (0x800000) +// ELF: SHF_AMDGPU_HSA_CODE (0x400000) +// ELF: SHF_EXECINSTR (0x4) +// ELF: SHF_WRITE (0x1) +// ELF: Size: 260 +// ELF: } + +.hsa_code_object_version 1,0 +// ASM: .hsa_code_object_version 1,0 + +.hsa_code_object_isa 7,0,0,"AMD","AMDGPU" +// ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" + +.text +// ASM: .hsatext + +.amd_kernel_code_t +.end_amd_kernel_code_t + +s_endpgm diff --git a/llvm/test/MC/AMDGPU/hsa.s b/llvm/test/MC/AMDGPU/hsa.s index 7dfea0fe787..ae50673492b 100644 --- a/llvm/test/MC/AMDGPU/hsa.s +++ b/llvm/test/MC/AMDGPU/hsa.s @@ -1,6 +1,17 @@ // 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 -s -sd | FileCheck %s --check-prefix=ELF +// ELF: Section { +// ELF: Name: .hsatext +// ELF: Type: SHT_PROGBITS (0x1) +// ELF: Flags [ (0xC00007) +// ELF: SHF_ALLOC (0x2) +// ELF: SHF_AMDGPU_HSA_AGENT (0x800000) +// ELF: SHF_AMDGPU_HSA_CODE (0x400000) +// ELF: SHF_EXECINSTR (0x4) +// ELF: SHF_WRITE (0x1) +// ELF: } + // ELF: SHT_NOTE // ELF: 0000: 04000000 08000000 01000000 414D4400 // ELF: 0010: 01000000 00000000 04000000 1B000000 @@ -14,7 +25,9 @@ .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" // ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" -.text +.hsatext +// ASM: .hsatext + amd_kernel_code_t_test_all: ; Test all amd_kernel_code_t members with non-default values. .amd_kernel_code_t |

