view test/Transforms/IndVarSimplify/pr24804.ll @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents 7d135dc70f03
children
line wrap: on
line source

; 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
}