46 lines · plain
1; RUN: llc < %s -mtriple=arm64-eabi -asm-verbose=false -mattr=v8.2a | FileCheck %s2; RUN: llc < %s -mtriple=arm64-eabi -asm-verbose=false -mattr=v8.3a | FileCheck %s --check-prefix=CHECKV833 4; Armv8.3-A Pointer Authetication requires a special intsruction to strip the5; pointer authentication code from the pointer.6; The XPACLRI instruction assembles to a hint-space instruction before Armv8.3-A7; therefore this instruction can be safely used for any pre Armv8.3-A architectures.8; On Armv8.3-A and onwards XPACI is available so use that instead.9 10define ptr @ra0() nounwind readnone {11entry:12; CHECK-LABEL: ra0:13; CHECK-NEXT: str x30, [sp, #-16]!14; CHECK-NEXT: hint #715; CHECK-NEXT: mov x0, x3016; CHECK-NEXT: ldr x30, [sp], #1617; CHECK-NEXT: ret18; CHECKV83: mov x0, x3019; CHECKV83-NEXT: xpaci x020; CHECKV83-NEXT: ret21 %0 = tail call ptr @llvm.returnaddress(i32 0)22 ret ptr %023}24 25define ptr @ra1() nounwind readnone #0 {26entry:27; CHECK-LABEL: ra1:28; CHECK: hint #2529; CHECK-NEXT: str x30, [sp, #-16]!30; CHECK-NEXT: hint #731; CHECK-NEXT: mov x0, x3032; CHECK-NEXT: ldr x30, [sp], #1633; CHECK-NEXT: hint #2934; CHECK-NEXT: ret35; CHECKV83: paciasp36; CHECKV83-NEXT: mov x0, x3037; CHECKV83-NEXT: xpaci x038; CHECKV83-NEXT: retaa39 %0 = tail call ptr @llvm.returnaddress(i32 0)40 ret ptr %041}42 43attributes #0 = { "sign-return-address"="all" }44 45declare ptr @llvm.returnaddress(i32) nounwind readnone46