1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "x86_64-unknown-linux-gnu"
6 define void @load1(ptr nocapture readonly %x) {
9 ; CHECK-NEXT: pushq %rax
10 ; CHECK-NEXT: .cfi_def_cfa_offset 16
11 ; CHECK-NEXT: callq __asan_check_load_add_1_RDI
12 ; CHECK-NEXT: callq __asan_check_store_add_1_RDI
13 ; CHECK-NEXT: popq %rax
14 ; CHECK-NEXT: .cfi_def_cfa_offset 8
16 call void @llvm.asan.check.memaccess(ptr %x, i32 0)
17 call void @llvm.asan.check.memaccess(ptr %x, i32 32)
21 define void @load2(ptr nocapture readonly %x) nounwind {
24 ; CHECK-NEXT: pushq %rax
25 ; CHECK-NEXT: callq __asan_check_load_add_2_RDI
26 ; CHECK-NEXT: callq __asan_check_store_add_2_RDI
27 ; CHECK-NEXT: popq %rax
29 %1 = ptrtoint ptr %x to i64
30 call void @llvm.asan.check.memaccess(ptr %x, i32 2)
31 call void @llvm.asan.check.memaccess(ptr %x, i32 34)
35 define void @load4(ptr nocapture readonly %x) nounwind {
38 ; CHECK-NEXT: pushq %rax
39 ; CHECK-NEXT: callq __asan_check_load_add_4_RDI
40 ; CHECK-NEXT: callq __asan_check_store_add_4_RDI
41 ; CHECK-NEXT: popq %rax
43 %1 = ptrtoint ptr %x to i64
44 call void @llvm.asan.check.memaccess(ptr %x, i32 4)
45 call void @llvm.asan.check.memaccess(ptr %x, i32 36)
49 define void @load8(ptr nocapture readonly %x) nounwind {
52 ; CHECK-NEXT: pushq %rax
53 ; CHECK-NEXT: callq __asan_check_load_add_8_RDI
54 ; CHECK-NEXT: callq __asan_check_store_add_8_RDI
55 ; CHECK-NEXT: popq %rax
57 %1 = ptrtoint ptr %x to i64
58 call void @llvm.asan.check.memaccess(ptr %x, i32 6)
59 call void @llvm.asan.check.memaccess(ptr %x, i32 38)
63 define void @load16(ptr nocapture readonly %x) nounwind {
64 ; CHECK-LABEL: load16:
66 ; CHECK-NEXT: pushq %rax
67 ; CHECK-NEXT: callq __asan_check_load_add_16_RDI
68 ; CHECK-NEXT: callq __asan_check_store_add_16_RDI
69 ; CHECK-NEXT: popq %rax
71 %1 = ptrtoint ptr %x to i64
72 call void @llvm.asan.check.memaccess(ptr %x, i32 8)
73 call void @llvm.asan.check.memaccess(ptr %x, i32 40)
77 declare void @llvm.asan.check.memaccess(ptr, i32 immarg)