blob: bea46a765d653fbf438ae3d58afdbe862a3c987e [file] [log] [blame]
Eli Friedman361e54d2009-05-09 12:32:42 +00001; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {count is 2}
2; PR3171
3
4 %struct.Foo = type { i32 }
5 %struct.NonPod = type { [2 x %struct.Foo] }
6
7define void @_Z3foov() nounwind {
8entry:
9 %x = alloca %struct.NonPod, align 8 ; <%struct.NonPod*> [#uses=2]
10 %0 = getelementptr %struct.NonPod* %x, i32 0, i32 0 ; <[2 x %struct.Foo]*> [#uses=1]
11 %1 = getelementptr [2 x %struct.Foo]* %0, i32 1, i32 0 ; <%struct.Foo*> [#uses=1]
12 br label %bb1.i
13
14bb1.i: ; preds = %bb2.i, %entry
15 %.0.i = phi %struct.Foo* [ %1, %entry ], [ %4, %bb2.i ] ; <%struct.Foo*> [#uses=2]
16 %2 = getelementptr %struct.NonPod* %x, i32 0, i32 0, i32 0 ; <%struct.Foo*> [#uses=1]
17 %3 = icmp eq %struct.Foo* %.0.i, %2 ; <i1> [#uses=1]
18 br i1 %3, label %_ZN6NonPodD1Ev.exit, label %bb2.i
19
20bb2.i: ; preds = %bb1.i
21 %4 = getelementptr %struct.Foo* %.0.i, i32 -1 ; <%struct.Foo*> [#uses=1]
22 br label %bb1.i
23
24_ZN6NonPodD1Ev.exit: ; preds = %bb1.i
25 ret void
26}
27