xref: /llvm-project/llvm/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll (revision 0d38f21e4ab7fe7cebe76a9d7c218ec54dba1e98)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
3; PR1533
4
5@array = weak global [101 x i32] zeroinitializer, align 32		; <ptr> [#uses=1]
6
7
8define void @loop(i32 %x) {
9; CHECK-LABEL: 'loop'
10; CHECK-NEXT:  Determining loop execution counts for: @loop
11; CHECK-NEXT:  Loop %bb: backedge-taken count is i32 100
12; CHECK-NEXT:  Loop %bb: constant max backedge-taken count is i32 100
13; CHECK-NEXT:  Loop %bb: symbolic max backedge-taken count is i32 100
14; CHECK-NEXT:  Loop %bb: Trip multiple is 101
15;
16entry:
17	br label %bb
18
19bb:		; preds = %bb, %entry
20	%i.01.0 = phi i32 [ 100, %entry ], [ %tmp4, %bb ]		; <i32> [#uses=2]
21	%tmp1 = getelementptr [101 x i32], ptr @array, i32 0, i32 %i.01.0		; <ptr> [#uses=1]
22	store i32 %x, ptr %tmp1
23	%tmp4 = add i32 %i.01.0, -1		; <i32> [#uses=2]
24	%tmp7 = icmp sgt i32 %tmp4, -1		; <i1> [#uses=1]
25	br i1 %tmp7, label %bb, label %return
26
27return:		; preds = %bb
28	ret void
29}
30