1 ; RUN: llc < %s | FileCheck %s
3 target triple = "aarch64--linux-android"
5 define i8* @f1(i8* %x0, i8* %x1) {
7 ; CHECK: str x30, [sp, #-16]!
8 ; CHECK-NEXT: .cfi_def_cfa_offset 16
9 ; CHECK-NEXT: .cfi_offset w30, -16
10 ; CHECK-NEXT: mov x9, x0
11 ; CHECK-NEXT: bl __hwasan_check_x1_1
12 ; CHECK-NEXT: mov x0, x1
13 ; CHECK-NEXT: ldr x30, [sp], #16
15 call void @llvm.hwasan.check.memaccess(i8* %x0, i8* %x1, i32 1)
19 define i8* @f2(i8* %x0, i8* %x1) {
21 ; CHECK: str x30, [sp, #-16]!
22 ; CHECK-NEXT: .cfi_def_cfa_offset 16
23 ; CHECK-NEXT: .cfi_offset w30, -16
24 ; CHECK-NEXT: mov x9, x1
25 ; CHECK-NEXT: bl __hwasan_check_x0_2_short
26 ; CHECK-NEXT: ldr x30, [sp], #16
28 call void @llvm.hwasan.check.memaccess.shortgranules(i8* %x1, i8* %x0, i32 2)
32 declare void @llvm.hwasan.check.memaccess(i8*, i8*, i32)
33 declare void @llvm.hwasan.check.memaccess.shortgranules(i8*, i8*, i32)
35 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x0_2_short,comdat
36 ; CHECK-NEXT: .type __hwasan_check_x0_2_short,@function
37 ; CHECK-NEXT: .weak __hwasan_check_x0_2_short
38 ; CHECK-NEXT: .hidden __hwasan_check_x0_2_short
39 ; CHECK-NEXT: __hwasan_check_x0_2_short:
40 ; CHECK-NEXT: ubfx x16, x0, #4, #52
41 ; CHECK-NEXT: ldrb w16, [x9, x16]
42 ; CHECK-NEXT: cmp x16, x0, lsr #56
43 ; CHECK-NEXT: b.ne .Ltmp0
47 ; CHECK-NEXT: cmp w16, #15
48 ; CHECK-NEXT: b.hi .Ltmp2
49 ; CHECK-NEXT: and x17, x0, #0xf
50 ; CHECK-NEXT: add x17, x17, #3
51 ; CHECK-NEXT: cmp w16, w17
52 ; CHECK-NEXT: b.ls .Ltmp2
53 ; CHECK-NEXT: orr x16, x0, #0xf
54 ; CHECK-NEXT: ldrb w16, [x16]
55 ; CHECK-NEXT: cmp x16, x0, lsr #56
56 ; CHECK-NEXT: b.eq .Ltmp1
58 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
59 ; CHECK-NEXT: stp x29, x30, [sp, #232]
60 ; CHECK-NEXT: mov x1, #2
61 ; CHECK-NEXT: adrp x16, :got:__hwasan_tag_mismatch_v2
62 ; CHECK-NEXT: ldr x16, [x16, :got_lo12:__hwasan_tag_mismatch_v2]
66 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x1_1,comdat
67 ; CHECK-NEXT: .type __hwasan_check_x1_1,@function
68 ; CHECK-NEXT: .weak __hwasan_check_x1_1
69 ; CHECK-NEXT: .hidden __hwasan_check_x1_1
70 ; CHECK-NEXT: __hwasan_check_x1_1:
71 ; CHECK-NEXT: ubfx x16, x1, #4, #52
72 ; CHECK-NEXT: ldrb w16, [x9, x16]
73 ; CHECK-NEXT: cmp x16, x1, lsr #56
74 ; CHECK-NEXT: b.ne .Ltmp3
78 ; CHECK-NEXT: stp x0, x1, [sp, #-256]!
79 ; CHECK-NEXT: stp x29, x30, [sp, #232]
80 ; CHECK-NEXT: mov x0, x1
81 ; CHECK-NEXT: mov x1, #1
82 ; CHECK-NEXT: adrp x16, :got:__hwasan_tag_mismatch
83 ; CHECK-NEXT: ldr x16, [x16, :got_lo12:__hwasan_tag_mismatch]