1 ; RUN: llc -mtriple aarch64--none-eabi -mattr=+bti < %s | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64-arm-none-eabi"
6 ; When BTI is enabled, all indirect tail-calls must use x16 or x17 (the intra
7 ; procedure call scratch registers) to hold the address, as these instructions
8 ; are allowed to target the "BTI c" instruction at the start of the target
9 ; function. The alternative to this would be to start functions with "BTI jc",
10 ; which increases the number of potential ways they could be called, and
11 ; weakens the security protections.
13 define void @bti_disabled(void ()* %p) {
20 define void @bti_enabled(void ()* %p) "branch-target-enforcement" {
23 ; CHECK: br {{x16|x17}}