1 ; Test KHWASan instrumentation.
2 ; Generic code is covered by ../kernel.ll, only the x86_64 specific code is
5 ; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -S | FileCheck %s --allow-empty --check-prefixes=INIT
6 ; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -S | FileCheck %s
7 ; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-mapping-offset=12345678 -S | FileCheck %s
8 ; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-recover=0 -S | FileCheck %s --check-prefixes=CHECK,ABORT
9 ; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-recover=1 -S | FileCheck %s --check-prefixes=CHECK,RECOVER
11 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
12 target triple = "x86_64-unknown-linux-gnu"
14 define i8 @test_load(ptr %a) sanitize_hwaddress {
15 ; CHECK-LABEL: @test_load(
16 ; CHECK: %[[A:[^ ]*]] = ptrtoint ptr %a to i64
18 ; ABORT: call void @__hwasan_load1(i64 %[[A]])
19 ; RECOVER: call void @__hwasan_load1_noabort(i64 %[[A]])
21 ; CHECK: %[[G:[^ ]*]] = load i8, ptr %a, align 4
22 ; CHECK: ret i8 %[[G]]
25 %b = load i8, ptr %a, align 4
29 ; INIT-NOT: call void @__hwasan_init