1; RUN: llc -march=hexagon -mcpu=hexagonv4 -O2 < %s | FileCheck %s 2; ModuleID = 'hwloop-const.c' 3target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32" 4target triple = "hexagon-unknown-linux-gnu" 5 6@b = common global [25000 x i32] zeroinitializer, align 8 7@a = common global [25000 x i32] zeroinitializer, align 8 8@c = common global [25000 x i32] zeroinitializer, align 8 9 10define i32 @hwloop_bug() nounwind { 11entry: 12 br label %for.body 13 14; CHECK: endloop 15for.body: ; preds = %for.body, %entry 16 %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 17 %arrayidx = getelementptr inbounds [25000 x i32], [25000 x i32]* @b, i32 0, i32 %i.02 18 store i32 %i.02, i32* %arrayidx, align 4 19 %arrayidx1 = getelementptr inbounds [25000 x i32], [25000 x i32]* @a, i32 0, i32 %i.02 20 store i32 %i.02, i32* %arrayidx1, align 4 21 %inc = add nsw i32 %i.02, 1 22 %exitcond = icmp eq i32 %inc, 25000 23 br i1 %exitcond, label %for.end, label %for.body 24 25for.end: ; preds = %for.body 26 ret i32 0 27} 28