1 ; RUN: llc -march=hexagon -hexagon-loop-range=0 < %s | FileCheck %s
3 ; Test that the loop start address operand uses a constant extender
4 ; if the offset is out of range.
9 @g = external global i32, align 4
11 define void @test(i32* nocapture %a, i32* nocapture readonly %b, i32 %n) #0 {
13 %cmp6 = icmp slt i32 %n, 1
14 br i1 %cmp6, label %for.end, label %for.body.preheader
20 %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
21 %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.07
22 %0 = load i32, i32* %arrayidx, align 4
23 %1 = load i32, i32* @g, align 4
24 %mul = mul nsw i32 %1, %0
25 %arrayidx1 = getelementptr inbounds i32, i32* %a, i32 %i.07
26 store i32 %mul, i32* %arrayidx1, align 4
27 %inc = add nuw nsw i32 %i.07, 1
28 %exitcond = icmp eq i32 %inc, %n
29 br i1 %exitcond, label %for.end.loopexit, label %for.body