brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 603c449 Raw
30 lines · plain
1; Test KHWASan instrumentation.2; Generic code is covered by ../kernel.ll, only the x86_64 specific code is3; tested here.4;5; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -S | FileCheck %s --allow-empty --check-prefixes=INIT6; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -S | FileCheck %s7; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-mapping-offset=12345678 -S | FileCheck %s8; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-recover=0 -S | FileCheck %s --check-prefixes=CHECK,ABORT9; RUN: opt < %s -passes=hwasan -hwasan-kernel=1 -hwasan-recover=1 -S | FileCheck %s --check-prefixes=CHECK,RECOVER10 11target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"12target triple = "x86_64-unknown-linux-gnu"13 14define i8 @test_load(ptr %a) sanitize_hwaddress {15; CHECK-LABEL: @test_load(16; CHECK: %[[A:[^ ]*]] = ptrtoint ptr %a to i6417 18; ABORT: call void @__hwasan_load1(i64 %[[A]])19; RECOVER: call void @__hwasan_load1_noabort(i64 %[[A]])20 21; CHECK: %[[G:[^ ]*]] = load i8, ptr %a, align 422; CHECK: ret i8 %[[G]]23 24entry:25  %b = load i8, ptr %a, align 426  ret i8 %b27}28 29; INIT-NOT: call void @__hwasan_init30