llvm-project/clang/test/CodeGen/aarch64-execute-only.c
Csanád Hajdú c579ec66c7
[Clang][AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (2/3) (#125688)
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.
Simlarly to ARM targets, generating object files with the
`SHF_AARCH64_PURECODE` flag set is enabled by the
`-mexecute-only`/`-mpure-code` driver flag.

Related PRs:
* LLVM: https://github.com/llvm/llvm-project/pull/125687
* LLD: https://github.com/llvm/llvm-project/pull/125689
2025-03-10 09:26:53 +00:00

20 lines
866 B
C

// RUN: %clang -target aarch64 -### %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
// RUN: %clang -target aarch64 -### -mexecute-only %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
// RUN: %clang -target aarch64 -### -mexecute-only -mno-execute-only %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
/// -mpure-code flag for GCC compatibility
// RUN: %clang -target aarch64 -### %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
// RUN: %clang -target aarch64 -### -mpure-code %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
// RUN: %clang -target aarch64 -### -mpure-code -mno-pure-code %s 2>&1 | \
// RUN: FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
// CHECK-NO-EXECUTE-ONLY-NOT: "+execute-only"
// CHECK-EXECUTE-ONLY: "+execute-only"
void a() {}