Skip to content

Commit b18377c

Browse files
committed
[GlobalsModRef] Generate test checks (NFC)
1 parent 105963a commit b18377c

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

llvm/test/Analysis/GlobalsModRef/memset-escape.ll

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
12
; RUN: opt < %s -O1 -S | FileCheck %s
23

34
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@@ -9,14 +10,22 @@ target triple = "x86_64-apple-macosx10.10.0"
910
; The important thing we're checking for here is the reload of (some element of)
1011
; @a after the memset.
1112

12-
; CHECK-LABEL: @main
13-
; CHECK: call void @llvm.memset.p0.i64{{.*}} @a
14-
; CHECK: store i32 3
15-
; CHECK: load i32, ptr getelementptr {{.*}} @a
16-
; CHECK: icmp eq i32
17-
; CHECK: br i1
18-
1913
define i32 @main() {
14+
; CHECK-LABEL: define noundef i32 @main(
15+
; CHECK-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] {
16+
; CHECK-NEXT: [[ENTRY:.*:]]
17+
; CHECK-NEXT: store i32 1, ptr getelementptr inbounds nuw (i8, ptr @a, i64 8), align 4
18+
; CHECK-NEXT: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) @a, i8 0, i64 12, i1 false)
19+
; CHECK-NEXT: store i32 3, ptr @b, align 4
20+
; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr getelementptr inbounds nuw (i8, ptr @a, i64 8), align 4
21+
; CHECK-NEXT: [[CMP1_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
22+
; CHECK-NEXT: br i1 [[CMP1_NOT]], label %[[IF_END:.*]], label %[[IF_THEN:.*]]
23+
; CHECK: [[IF_THEN]]:
24+
; CHECK-NEXT: tail call void @abort()
25+
; CHECK-NEXT: unreachable
26+
; CHECK: [[IF_END]]:
27+
; CHECK-NEXT: ret i32 0
28+
;
2029
entry:
2130
%retval = alloca i32, align 4
2231
%c = alloca [1 x i32], align 4

0 commit comments

Comments
 (0)