brintos

brintos / llvm-project-archived public Read only

0
0
Text · 625 B · 07b28f4 Raw
21 lines · plain
1; Remove possible memory effects from functions that are invalidated by2; AddressSanitizer instrumentation.3 4; RUN: opt -passes='asan<use-after-scope>' -S %s | FileCheck %s5 6; CHECK: @foo(ptr writeonly) #[[ATTRS_FOO:[0-9]+]]7declare void @foo(ptr writeonly) memory(argmem: write)8 9; CHECK: @bar() #[[ATTRS_BAR:[0-9]+]]10define void @bar() sanitize_address {11entry:12  %x = alloca i32, align 413  call void @llvm.lifetime.start.p0(ptr %x)14  call void @foo(ptr %x)15  call void @llvm.lifetime.end.p0(ptr %x)16  ret void17}18 19; CHECK: attributes #[[ATTRS_FOO]] = { nobuiltin }20; CHECK: attributes #[[ATTRS_BAR]] = { sanitize_address }21