blob: 2b1758b0107a1ee32aea092d68c94a91c51e959c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
;; This file contains the previous semantic of the branch-target-enforcement, sign-return-address.
;; Used for test mixing a mixed link case and also verify the import too in llc.
; RUN: llc -mattr=+pauth -mattr=+bti %s -o - | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"
define i32 @old_bti() #0 {
entry:
ret i32 2
}
; CHECK-LABEL: old_bti:
; CHECK: bti c
; CHECK: mov
; CHECK: ret
define i32 @old_pac() #1 {
entry:
ret i32 2
}
; CHECK-LABEL: old_pac:
; CHECK: paciasp
; CHECK: mov
; CHECK: retaa
define i32 @old_none() #2 {
entry:
ret i32 3
}
; CHECK-LABEL: old_none:
; CHECK-NOT: hint
; CHECK-NOT: paci
; CHECK-NOT: bti
; CHECK: ret
declare i32 @func(i32)
define i32 @old_none_leaf() #3 {
entry:
%0 = call i32 @func()
ret i32 %0
}
; CHECK-LABEL: old_none_leaf:
; CHECK: paciasp
; CHECK: bl func
; CHECK: retaa
attributes #0 = { noinline nounwind optnone "branch-target-enforcement"="true" }
attributes #1 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="all" "sign-return-address-key"="a_key" }
attributes #2 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="none" }
attributes #3 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" }
;; Intentionally no module flags
|