llvm-project/llvm/test/CodeGen/AArch64/execute-only-empty.ll
Csanád Hajdú e2e776c867
[AArch64] Always add PURECODE flag to empty .text if "+execute-only" is set (#132196)
Previously, the `SHF_AARCH64_PURECODE` section flag wasn't added to the
implicitly created `.text` section if the module didn't contain any
functions, because no other section had the flag set.

Now, the `SHF_AARCH64_PURECODE` is always added if the "+execute-only"
target feature is set for the module during compilation.
2025-03-24 11:19:26 +01:00

14 lines
405 B
LLVM

; RUN: llc -filetype=obj -mtriple=aarch64 -mattr=+execute-only %s -o %t.o
; RUN: llvm-readobj -S %t.o | FileCheck %s
; CHECK: Name: .text
; CHECK-NEXT: Type: SHT_PROGBITS
; CHECK-NEXT: Flags [
; CHECK-NEXT: SHF_AARCH64_PURECODE
; CHECK-NEXT: SHF_ALLOC
; CHECK-NEXT: SHF_EXECINSTR
; CHECK-NEXT: ]
; CHECK-NEXT: Address:
; CHECK-NEXT: Offset:
; CHECK-NEXT: Size: 0