2021-07-13 06:14:26 -05:00
|
|
|
// Test that PAC instructions are emitted when branch-protection is specified.
|
|
|
|
|
2024-10-16 09:39:58 -05:00
|
|
|
//@ revisions: PACRET PAUTHLR_NOP PAUTHLR
|
2024-02-22 06:10:29 -06:00
|
|
|
//@ assembly-output: emit-asm
|
|
|
|
//@ needs-llvm-components: aarch64
|
2024-10-16 09:39:58 -05:00
|
|
|
//@ compile-flags: --target aarch64-unknown-linux-gnu
|
|
|
|
//@ [PACRET] compile-flags: -Z branch-protection=pac-ret,leaf
|
|
|
|
//@ [PAUTHLR_NOP] compile-flags: -Z branch-protection=pac-ret,pc,leaf
|
|
|
|
//@ [PAUTHLR] compile-flags: -C target-feature=+pauth-lr -Z branch-protection=pac-ret,pc,leaf
|
|
|
|
//@ min-llvm-version: 19
|
2021-07-13 06:14:26 -05:00
|
|
|
|
|
|
|
#![feature(no_core, lang_items)]
|
|
|
|
#![no_std]
|
|
|
|
#![no_core]
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
#[lang = "sized"]
|
|
|
|
trait Sized {}
|
|
|
|
|
2024-10-16 09:39:58 -05:00
|
|
|
// PACRET: hint #25
|
|
|
|
// PACRET: hint #29
|
|
|
|
// PAUTHLR_NOP: hint #25
|
|
|
|
// PAUTHLR_NOP: hint #39
|
|
|
|
// PAUTHLR_NOP: hint #29
|
|
|
|
// PAUTHLR: paciasppc
|
|
|
|
// PAUTHLR: autiasppc
|
2021-07-13 06:14:26 -05:00
|
|
|
#[no_mangle]
|
|
|
|
pub fn test() -> u8 {
|
|
|
|
42
|
|
|
|
}
|