From 837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5 Mon Sep 17 00:00:00 2001 From: James McGregor Date: Tue, 13 Jul 2021 12:14:26 +0100 Subject: Add codegen option for branch protection and pointer authentication on AArch64 The branch-protection codegen option enables the use of hint-space pointer authentication code for AArch64 targets --- src/test/assembly/aarch64-pointer-auth.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/assembly/aarch64-pointer-auth.rs (limited to 'src/test/assembly') diff --git a/src/test/assembly/aarch64-pointer-auth.rs b/src/test/assembly/aarch64-pointer-auth.rs new file mode 100644 index 00000000000..e778e67e1b3 --- /dev/null +++ b/src/test/assembly/aarch64-pointer-auth.rs @@ -0,0 +1,22 @@ +// Test that PAC instructions are emitted when branch-protection is specified. + +// min-llvm-version: 10.0.1 +// assembly-output: emit-asm +// compile-flags: --target aarch64-unknown-linux-gnu +// compile-flags: -C branch-protection=pac-ret+leaf +// needs-llvm-components: aarch64 + +#![feature(no_core, lang_items)] +#![no_std] +#![no_core] +#![crate_type = "lib"] + +#[lang = "sized"] +trait Sized {} + +// CHECK: hint #25 +// CHECK: hint #29 +#[no_mangle] +pub fn test() -> u8 { + 42 +} -- cgit 1.4.1-3-g733a5