xref: /llvm-project/llvm/test/Analysis/ScalarEvolution/values-at-scopes-consistency.ll (revision 92619956eb27ef08dd24045307593fc3d7f78db0)
1; RUN: opt -S -passes='verify<scalar-evolution>' < %s
2
3; Make sure this does not fail ValuesAtScopes consistency verification.
4; This used to register a ValuesAtScopes user, even though nothing was
5; added to ValuesAtScope due to a prior invalidation.
6
7define void @main(ptr %p) {
8entry:
9  br label %loop1
10
11loop1:
12  br label %loop2
13
14loop2:
15  %i = phi i64 [ 0, %loop1 ], [ %i.next, %loop2.latch ]
16  %i.next = add nuw nsw i64 %i, 1
17  %gep = getelementptr i8, ptr %p, i64 %i
18  %val = load i8, ptr %gep
19  %c = icmp eq i8 %val, 0
20  br i1 %c, label %loop2.latch, label %exit
21
22loop2.latch:
23  br i1 false, label %loop2, label %loop1.latch
24
25loop1.latch:
26  br label %loop1
27
28exit:
29  ret void
30}
31