1 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs < %s | FileCheck %s --check-prefix=ASM
2 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -global-isel < %s | FileCheck %s --check-prefix=ASM
4 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -stop-after=finalize-isel < %s | FileCheck %s --check-prefixes=MIR,ISEL
5 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -stop-after=finalize-isel -global-isel < %s | FileCheck %s --check-prefixes=MIR,ISEL
7 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -mattr=harden-sls-blr -stop-after=finalize-isel < %s | FileCheck %s --check-prefixes=MIR,ISEL-SLS
8 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -mattr=harden-sls-blr -stop-after=finalize-isel -global-isel < %s | FileCheck %s --check-prefixes=MIR,ISEL-SLS
10 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -stop-after=kcfi < %s | FileCheck %s --check-prefixes=MIR,KCFI
11 ; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -mattr=harden-sls-blr -stop-after=kcfi < %s | FileCheck %s --check-prefixes=MIR,KCFI-SLS
14 define void @f1(ptr noundef %x) !kcfi_type !1 {
17 ; ASM: ldur w16, [x0, #-4]
18 ; ASM-NEXT: movk w17, #24910
19 ; ASM-NEXT: movk w17, #188, lsl #16
20 ; ASM-NEXT: cmp w16, w17
21 ; ASM-NEXT: b.eq .Ltmp0
22 ; ASM-NEXT: brk #0x8220
29 ; ISEL: BLR %0, csr_aarch64_aapcs,{{.*}} cfi-type 12345678
30 ; ISEL-SLS: BLRNoIP %0, csr_aarch64_aapcs,{{.*}} cfi-type 12345678
32 ; KCFI: BUNDLE{{.*}} {
33 ; KCFI-NEXT: KCFI_CHECK $x0, 12345678, implicit-def $x9, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
34 ; KCFI-NEXT: BLR killed $x0, csr_aarch64_aapcs,{{.*}}
37 ; KCFI-SLS: BUNDLE{{.*}} {
38 ; KCFI-SLS-NEXT: KCFI_CHECK $x0, 12345678, implicit-def $x9, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
39 ; KCFI-SLS-NEXT: BLRNoIP killed $x0, csr_aarch64_aapcs,{{.*}}
42 call void %x() [ "kcfi"(i32 12345678) ]
47 define void @f2(ptr noundef %x) #0 {
52 ; ASM: ldur w16, [x0, #-4]
53 ; ASM-NEXT: movk w17, #24910
54 ; ASM-NEXT: movk w17, #188, lsl #16
55 ; ASM-NEXT: cmp w16, w17
56 ; ASM-NEXT: b.eq .Ltmp1
57 ; ASM-NEXT: brk #0x8220
64 ; ISEL: TCRETURNri %0, 0, csr_aarch64_aapcs, implicit $sp, cfi-type 12345678
66 ; KCFI: BUNDLE{{.*}} {
67 ; KCFI-NEXT: KCFI_CHECK $x0, 12345678, implicit-def $x9, implicit-def $x16, implicit-def $x17, implicit-def $nzcv
68 ; KCFI-NEXT: TCRETURNri killed $x0, 0, csr_aarch64_aapcs, implicit $sp
71 tail call void %x() [ "kcfi"(i32 12345678) ]
75 attributes #0 = { "patchable-function-entry"="2" }
77 !llvm.module.flags = !{!0}
78 !0 = !{i32 4, !"kcfi", i32 1}