brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · fd45fe2 Raw
65 lines · plain
1; RUN: opt < %s -passes=instcombine -S | FileCheck %s2 3declare void @llvm.lifetime.start.p0(ptr nocapture)4declare void @llvm.lifetime.end.p0(ptr nocapture)5declare void @foo(ptr nocapture)6 7define void @asan() sanitize_address {8entry:9  ; CHECK-LABEL: @asan(10  %text = alloca i8, align 111 12  call void @llvm.lifetime.start.p0(ptr %text)13  call void @llvm.lifetime.end.p0(ptr %text)14  ; CHECK: call void @llvm.lifetime.start15  ; CHECK-NEXT: call void @llvm.lifetime.end16 17  call void @foo(ptr %text) ; Keep alloca alive18 19  ret void20}21 22define void @hwasan() sanitize_hwaddress {23entry:24  ; CHECK-LABEL: @hwasan(25  %text = alloca i8, align 126 27  call void @llvm.lifetime.start.p0(ptr %text)28  call void @llvm.lifetime.end.p0(ptr %text)29  ; CHECK: call void @llvm.lifetime.start30  ; CHECK-NEXT: call void @llvm.lifetime.end31 32  call void @foo(ptr %text) ; Keep alloca alive33 34  ret void35}36 37define void @msan() sanitize_memory {38entry:39  ; CHECK-LABEL: @msan(40  %text = alloca i8, align 141 42  call void @llvm.lifetime.start.p0(ptr %text)43  call void @llvm.lifetime.end.p0(ptr %text)44  ; CHECK: call void @llvm.lifetime.start45  ; CHECK-NEXT: call void @llvm.lifetime.end46 47  call void @foo(ptr %text) ; Keep alloca alive48 49  ret void50}51 52define void @no_asan() {53entry:54  ; CHECK-LABEL: @no_asan(55  %text = alloca i8, align 156 57  call void @llvm.lifetime.start.p0(ptr %text)58  call void @llvm.lifetime.end.p0(ptr %text)59  ; CHECK-NO: call void @llvm.lifetime60 61  call void @foo(ptr %text) ; Keep alloca alive62 63  ret void64}65