Xamarin Public Jenkins (auto-signing) f32dbaf0b2 Imported Upstream version 5.18.0.225
Former-commit-id: 10196d987d5fc5564b9d3b33b1fdf13190f4d0b5
2018-12-21 19:01:49 +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
}