| 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 |
define i32 @foo_on() #0 { |
| 10 |
entry: |
| 11 |
ret i32 42 |
| 12 |
} |
| 13 |
|
| 14 |
; CHECK-LABEL: foo_on: |
| 15 |
; CHECK: pacibsp |
| 16 |
; CHECK: mov |
| 17 |
; CHECK: retab |
| 18 |
|
| 19 |
define i32 @foo_off() #1 { |
| 20 |
entry: |
| 21 |
ret i32 43 |
| 22 |
} |
| 23 |
|
| 24 |
; CHECK-LABEL: foo_off: |
| 25 |
; CHECK-NOT: pac |
| 26 |
; CHECK-NOT: hint |
| 27 |
; CHECK-NOT: bti |
| 28 |
; CHECK: ret |
| 29 |
|
| 30 |
attributes #0 = { noinline nounwind optnone uwtable } |
| 31 |
attributes #1 = { noinline nounwind optnone uwtable "branch-target-enforcement"="false" "sign-return-address"="none" } |
| 32 |
|
| 33 |
!llvm.module.flags = !{!0, !1, !2, !3} |
| 34 |
|
| 35 |
!0 = !{i32 8, !"branch-target-enforcement", i32 1} |
| 36 |
!1 = !{i32 8, !"sign-return-address", i32 1} |
| 37 |
!2 = !{i32 8, !"sign-return-address-all", i32 1} |
| 38 |
!3 = !{i32 8, !"sign-return-address-with-bkey", i32 1} |