llvm-project/llvm/test/CodeGen/AArch64/execute-only-section.ll
Csanád Hajdú a190f15d2b
[AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (1/3) (#125687)
Add support for the new SHF_AARCH64_PURECODE ELF section flag:
https://github.com/ARM-software/abi-aa/pull/304

The general implementation follows the existing one for ARM targets.
Generating object files with the `SHF_AARCH64_PURECODE` flag set is
enabled by the `+execute-only` target feature.

Related PRs:
* Clang: https://github.com/llvm/llvm-project/pull/125688
* LLD: https://github.com/llvm/llvm-project/pull/125689
2025-02-14 08:56:07 +00:00

40 lines
1.0 KiB
LLVM

; RUN: llc -mtriple=aarch64 -mattr=+execute-only %s -o - | FileCheck %s
$test_comdat = comdat any
; CHECK: .section .text,"axy",@progbits,unique,0
; CHECK-NOT: .section
; CHECK-NOT: .text
; CHECK: .globl test_section_for_global
; CHECK: .type test_section_for_global,@function
define void @test_section_for_global() {
entry:
ret void
}
; CHECK: .section .text.test_comdat,"axGy",@progbits,test_comdat,comdat,unique,0
; CHECK-NOT: .section
; CHECK-NOT: .text
; CHECK: .weak test_comdat
; CHECK: .type test_comdat,@function
define linkonce_odr void @test_comdat() comdat {
entry:
ret void
}
; CHECK: .section .test,"axy",@progbits
; CHECK-NOT: .section
; CHECK-NOT: .text
; CHECK: .globl test_explicit_section_for_global
; CHECK: .type test_explicit_section_for_global,@function
define void @test_explicit_section_for_global() section ".test" {
entry:
ret void
}
; CHECK: .rodata,"a",@progbits
; CHECK-NOT: .section
; CHECK-NOT: .text
; CHECK: .globl test_rodata
@test_rodata = constant i32 0, align 4