brintos

brintos / llvm-project-archived public Read only

0
0
Text · 989 B · d891fde Raw
24 lines · plain
1; Test that HWASan remove writeonly and memory(*) attributes from instrumented functions.2; RUN: opt -S -passes=hwasan %s | FileCheck %s3 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"5target triple = "aarch64-unknown-linux-android30"6 7; CHECK: define dso_local void @test_writeonly(ptr noundef captures(none) %p) local_unnamed_addr #08define dso_local void @test_writeonly(ptr noundef writeonly captures(none) %p) local_unnamed_addr #0 {9entry:10  store i32 42, ptr %p, align 411  ret void12}13 14; CHECK: define dso_local void @test_readonly(ptr noundef readonly captures(none) %p) local_unnamed_addr #015define dso_local void @test_readonly(ptr noundef readonly captures(none) %p) local_unnamed_addr #1 {16entry:17  store i32 42, ptr %p, align 418  ret void19}20 21; CHECK: attributes #0 = { nobuiltin sanitize_hwaddress uwtable }22attributes #0 = { sanitize_hwaddress memory(argmem: write) uwtable }23attributes #1 = { sanitize_hwaddress memory(argmem: read) uwtable }24