brintos

brintos / llvm-project-archived public Read only

0
0
Text · 809 B · cad68af Raw
24 lines · plain
1; Make sure memaccess checks preceed the following reads.2;3; RUN: opt < %s -disable-output 2>&1 -passes='hwasan,print<memoryssa>' -hwasan-use-stack-safety=0 -mtriple aarch64-linux-android30 | FileCheck %s4 5target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"6target triple = "aarch64--linux-android10000"7 8declare void @use32(ptr)9 10define i32 @test_alloca() sanitize_hwaddress {11entry:12  %x = alloca i32, align 413  ; CHECK: call void @use3214  call void @use32(ptr nonnull %x)15  ; CHECK: [[A:[0-9]+]] = MemoryDef({{[0-9]+}})16  ; CHECK-NEXT: call void @llvm.hwasan.check.memaccess.shortgranules17  ; CHECK: MemoryUse([[A]])18  ; CHECK-NEXT: load i32, ptr %x.hwasan19  %y = load i32, ptr %x20  ; CHECK: {{[0-9]+}} = MemoryDef([[A]])21  ; CHECK-NEXT: call void @llvm.memset.p0.i6422  ret i32 %y23}24