| 1 |
;; This file contains the previous semantic of the branch-target-enforcement, sign-return-address. |
| 2 |
;; Used for test mixing a mixed link case and also verify the import too in llc. |
| 3 |
|
| 4 |
; RUN: llc -mattr=+pauth -mattr=+bti %s -o - | FileCheck %s |
| 5 |
|
| 6 |
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
| 7 |
target triple = "aarch64-unknown-linux-gnu" |
| 8 |
|
| 9 |
declare void @func() |
| 10 |
|
| 11 |
define i32 @fiz_on() #0 { |
| 12 |
entry: |
| 13 |
call void @func() |
| 14 |
ret i32 42 |
| 15 |
} |
| 16 |
|
| 17 |
; CHECK-LABEL: fiz_on: |
| 18 |
; CHECK: paciasp |
| 19 |
; CHECK: bl func |
| 20 |
; CHECK: retaa |
| 21 |
|
| 22 |
define i32 @fiz_off() #1 { |
| 23 |
entry: |
| 24 |
ret i32 43 |
| 25 |
} |
| 26 |
|
| 27 |
; CHECK-LABEL: fiz_off: |
| 28 |
; CHECK-NOT: pac |
| 29 |
; CHECK-NOT: hint |
| 30 |
; CHECK-NOT: bti |
| 31 |
; CHECK: ret |
| 32 |
|
| 33 |
attributes #0 = { noinline nounwind optnone uwtable } |
| 34 |
attributes #1 = { noinline nounwind optnone uwtable "branch-target-enforcement"="false" "sign-return-address"="none" } |
| 35 |
|
| 36 |
!llvm.module.flags = !{!0, !1, !2, !3} |
| 37 |
|
| 38 |
!0 = !{i32 8, !"branch-target-enforcement", i32 1} |
| 39 |
!1 = !{i32 8, !"sign-return-address", i32 1} |
| 40 |
!2 = !{i32 8, !"sign-return-address-all", i32 0} |
| 41 |
!3 = !{i32 8, !"sign-return-address-with-bkey", i32 0} |