1;; RUN: llc -mtriple=aarch64-eabi -mattr=+v8.5a %s -o - | FileCheck %s 2 3declare i32 @g(i32) #5 4 5define i32 @f0(i32 %x) #0 { 6entry: 7 %call = tail call i32 @g(i32 %x) #5 8 %add = add nsw i32 %call, 1 9 ret i32 %add 10} 11;; CHECK-LABEL: f0: 12;; CHECK-NOT: bti 13;; CHECK-NOT: pacia 14;; CHECK-NOT: reta 15 16define i32 @f1(i32 %x) #1 { 17entry: 18 %call = tail call i32 @g(i32 %x) #5 19 %add = add nsw i32 %call, 1 20 ret i32 %add 21} 22;; CHECK-LABEL: f1: 23;; CHECK: bti c 24;; CHECK-NOT: reta 25 26define i32 @f2(i32 %x) #2 { 27entry: 28 %call = tail call i32 @g(i32 %x) #5 29 %add = add nsw i32 %call, 1 30 ret i32 %add 31} 32;; CHECK-LABEL: f2: 33;; CHECK: paciasp 34;; CHECK: retaa 35 36define i32 @f3(i32 %x) #3 { 37entry: 38 %call = tail call i32 @g(i32 %x) #5 39 %add = add nsw i32 %call, 1 40 ret i32 %add 41} 42;; CHECK-LABEL: f3: 43;; CHECK: pacibsp 44;; CHECK: retab 45 46define i32 @f4(i32 %x) #4 { 47entry: 48 ret i32 1 49} 50;; CHECK-LABEL: f4: 51;; CHECK: paciasp 52;; CHECK: retaa 53 54define i32 @f5(i32 %x) #5 { 55entry: 56 %call = tail call i32 @g(i32 %x) #5 57 %add = add nsw i32 %call, 1 58 ret i32 %add 59} 60;; CHECK-LABEL: f5: 61;; CHECK: paciasp 62;; CHECK: retaa 63 64attributes #0 = { nounwind "branch-target-enforcement"="false" "sign-return-address"="none" } 65attributes #1 = { nounwind "branch-target-enforcement"="true" "sign-return-address"="none" } 66attributes #2 = { nounwind "branch-target-enforcement"="false" "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" } 67attributes #3 = { nounwind "branch-target-enforcement"="false" "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" } 68attributes #4 = { nounwind "branch-target-enforcement"="false" "sign-return-address"="all" "sign-return-address-key"="a_key" } 69attributes #5 = { nounwind } 70 71!llvm.module.flags = !{!0, !1, !2, !3, !4} 72 73!0 = !{i32 1, !"wchar_size", i32 4} 74!1 = !{i32 1, !"branch-target-enforcement", i32 1} 75!2 = !{i32 1, !"sign-return-address", i32 1} 76!3 = !{i32 1, !"sign-return-address-all", i32 0} 77!4 = !{i32 1, !"sign-return-address-with-bkey", i32 0} 78