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_123
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 123)
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_456
26 ; CHECK-NEXT: ldr x30, [sp], #16
28 call void @llvm.hwasan.check.memaccess(i8* %x1, i8* %x0, i32 456)
32 declare void @llvm.hwasan.check.memaccess(i8*, i8*, i32)
34 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x0_456,comdat
35 ; CHECK-NEXT: .type __hwasan_check_x0_456,@function
36 ; CHECK-NEXT: .weak __hwasan_check_x0_456
37 ; CHECK-NEXT: .hidden __hwasan_check_x0_456
38 ; CHECK-NEXT: __hwasan_check_x0_456:
39 ; CHECK-NEXT: ubfx x16, x0, #4, #52
40 ; CHECK-NEXT: ldrb w16, [x9, x16]
41 ; CHECK-NEXT: lsr x17, x0, #56
42 ; CHECK-NEXT: cmp w16, w17
43 ; CHECK-NEXT: b.ne .Ltmp0
46 ; CHECK-NEXT: mov x1, #456
47 ; CHECK-NEXT: b __hwasan_tag_mismatch
49 ; CHECK: .section .text.hot,"axG",@progbits,__hwasan_check_x1_123,comdat
50 ; CHECK-NEXT: .type __hwasan_check_x1_123,@function
51 ; CHECK-NEXT: .weak __hwasan_check_x1_123
52 ; CHECK-NEXT: .hidden __hwasan_check_x1_123
53 ; CHECK-NEXT: __hwasan_check_x1_123:
54 ; CHECK-NEXT: ubfx x16, x1, #4, #52
55 ; CHECK-NEXT: ldrb w16, [x9, x16]
56 ; CHECK-NEXT: lsr x17, x1, #56
57 ; CHECK-NEXT: cmp w16, w17
58 ; CHECK-NEXT: b.ne .Ltmp1
61 ; CHECK-NEXT: mov x0, x1
62 ; CHECK-NEXT: mov x1, #123
63 ; CHECK-NEXT: b __hwasan_tag_mismatch