llvm.org GIT mirror llvm / 9bd808a
NFC: Rename lifetime-asan.ll -> lifetime-sanitizer.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369831 91177308-0d34-0410-b5e6-96231b3b80d8 Vitaly Buka 28 days ago
2 changed file(s) with 49 addition(s) and 49 deletion(s). Raw diff Collapse all Expand all
+0
-49
test/Transforms/InstCombine/lifetime-asan.ll less more
None ; RUN: opt < %s -instcombine -S | FileCheck %s
1
2 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
3 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
4 declare void @foo(i8* nocapture)
5
6 define void @asan() sanitize_address {
7 entry:
8 ; CHECK-LABEL: @asan(
9 %text = alloca i8, align 1
10
11 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
12 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
13 ; CHECK: call void @llvm.lifetime.start
14 ; CHECK-NEXT: call void @llvm.lifetime.end
15
16 call void @foo(i8* %text) ; Keep alloca alive
17
18 ret void
19 }
20
21 define void @hwasan() sanitize_hwaddress {
22 entry:
23 ; CHECK-LABEL: @hwasan(
24 %text = alloca i8, align 1
25
26 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
27 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
28 ; CHECK: call void @llvm.lifetime.start
29 ; CHECK-NEXT: call void @llvm.lifetime.end
30
31 call void @foo(i8* %text) ; Keep alloca alive
32
33 ret void
34 }
35
36 define void @no_asan() {
37 entry:
38 ; CHECK-LABEL: @no_asan(
39 %text = alloca i8, align 1
40
41 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
42 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
43 ; CHECK-NO: call void @llvm.lifetime
44
45 call void @foo(i8* %text) ; Keep alloca alive
46
47 ret void
48 }
0 ; RUN: opt < %s -instcombine -S | FileCheck %s
1
2 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
3 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
4 declare void @foo(i8* nocapture)
5
6 define void @asan() sanitize_address {
7 entry:
8 ; CHECK-LABEL: @asan(
9 %text = alloca i8, align 1
10
11 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
12 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
13 ; CHECK: call void @llvm.lifetime.start
14 ; CHECK-NEXT: call void @llvm.lifetime.end
15
16 call void @foo(i8* %text) ; Keep alloca alive
17
18 ret void
19 }
20
21 define void @hwasan() sanitize_hwaddress {
22 entry:
23 ; CHECK-LABEL: @hwasan(
24 %text = alloca i8, align 1
25
26 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
27 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
28 ; CHECK: call void @llvm.lifetime.start
29 ; CHECK-NEXT: call void @llvm.lifetime.end
30
31 call void @foo(i8* %text) ; Keep alloca alive
32
33 ret void
34 }
35
36 define void @no_asan() {
37 entry:
38 ; CHECK-LABEL: @no_asan(
39 %text = alloca i8, align 1
40
41 call void @llvm.lifetime.start.p0i8(i64 1, i8* %text)
42 call void @llvm.lifetime.end.p0i8(i64 1, i8* %text)
43 ; CHECK-NO: call void @llvm.lifetime
44
45 call void @foo(i8* %text) ; Keep alloca alive
46
47 ret void
48 }