Xamarin Public Jenkins (auto-signing) e19d552987 Imported Upstream version 5.18.0.161
Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
2018-10-19 08:34:24 +00:00

26 lines
805 B
LLVM

; RUN: opt -indvars -loop-idiom -loop-deletion -S < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Checking for a crash
define void @f(i32* %a) {
; CHECK-LABEL: @f(
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %for.cond, %entry
%iv = phi i32 [ 0, %entry ], [ %add, %for.inc ], [ %iv, %for.cond ]
%add = add nsw i32 %iv, 1
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
br i1 undef, label %for.cond, label %for.inc
for.inc: ; preds = %for.cond
br i1 undef, label %for.cond, label %for.end
for.end: ; preds = %for.inc
ret void
}