-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 | ||
; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s | ||
|
||
@p = dso_local local_unnamed_addr global i64 0, align 8 | ||
@l = dso_local local_unnamed_addr global ptr null, align 8 | ||
@c = dso_local local_unnamed_addr global i32 0, align 4 | ||
|
||
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) | ||
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) | ||
|
||
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) | ||
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) | ||
|
||
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable | ||
define i32 @main() #1 { | ||
; CHECK-LABEL: main: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: movl $0, c(%rip) | ||
; CHECK-NEXT: movq $64, p(%rip) | ||
; CHECK-NEXT: cmpl $42828, -{{[0-9]+}}(%rsp) # imm = 0xA74C | ||
; CHECK-NEXT: jg .LBB0_2 | ||
; CHECK-NEXT: # %bb.1: # %if.then.1.i | ||
; CHECK-NEXT: movq l(%rip), %rax | ||
; CHECK-NEXT: movb $0, (%rax) | ||
; CHECK-NEXT: .LBB0_2: # %t.exit | ||
; CHECK-NEXT: xorl %eax, %eax | ||
; CHECK-NEXT: retq | ||
entry: | ||
%a.i = alloca [2 x i32], align 4 | ||
store i32 0, ptr @c, align 4 | ||
%arrayidx15.i = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 1 | ||
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a.i) | ||
store i32 50009, ptr %a.i, align 4 | ||
%arrayidx.i.1 = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 1 | ||
store i32 50009, ptr %arrayidx.i.1, align 4 | ||
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a.i) | ||
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a.i) | ||
store i64 64, ptr @p, align 8 | ||
%0 = load i32, ptr @c, align 4 | ||
%idxprom.1.i = zext i32 %0 to i64 | ||
%arrayidx.1.i = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 %idxprom.1.i | ||
store i32 50009, ptr %arrayidx.1.i, align 4 | ||
%add14.1.i.1 = add i32 %0, 1 | ||
%idxprom.1.i.1 = zext i32 %add14.1.i.1 to i64 | ||
%arrayidx.1.i.1 = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 %idxprom.1.i.1 | ||
store i32 50009, ptr %arrayidx.1.i.1, align 4 | ||
%1 = load i32, ptr %arrayidx15.i, align 4 | ||
%cmp16.1.i = icmp slt i32 %1, 42829 | ||
br i1 %cmp16.1.i, label %if.then.1.i, label %t.exit | ||
|
||
if.then.1.i: ; preds = %entry | ||
%2 = load ptr, ptr @l, align 8 | ||
store i8 0, ptr %2, align 1 | ||
br label %t.exit | ||
|
||
t.exit: ; preds = %entry, %if.then.1.i | ||
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a.i) | ||
ret i32 0 | ||
} | ||
|