blob: 8a780431345e273134b4598fd1569eee206ba7c1 [file] [log] [blame]
Chandler Carruth4177e6f2012-07-02 12:47:22 +00001; RUN: opt < %s -analyze -scalar-evolution | grep "count is 2"
Eli Friedman361e54d2009-05-09 12:32:42 +00002; PR3171
Kenneth Uildriksb908f8a2009-11-03 15:29:06 +00003target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
Eli Friedman361e54d2009-05-09 12:32:42 +00004
5 %struct.Foo = type { i32 }
6 %struct.NonPod = type { [2 x %struct.Foo] }
7
8define void @_Z3foov() nounwind {
9entry:
10 %x = alloca %struct.NonPod, align 8 ; <%struct.NonPod*> [#uses=2]
11 %0 = getelementptr %struct.NonPod* %x, i32 0, i32 0 ; <[2 x %struct.Foo]*> [#uses=1]
12 %1 = getelementptr [2 x %struct.Foo]* %0, i32 1, i32 0 ; <%struct.Foo*> [#uses=1]
13 br label %bb1.i
14
15bb1.i: ; preds = %bb2.i, %entry
16 %.0.i = phi %struct.Foo* [ %1, %entry ], [ %4, %bb2.i ] ; <%struct.Foo*> [#uses=2]
17 %2 = getelementptr %struct.NonPod* %x, i32 0, i32 0, i32 0 ; <%struct.Foo*> [#uses=1]
18 %3 = icmp eq %struct.Foo* %.0.i, %2 ; <i1> [#uses=1]
19 br i1 %3, label %_ZN6NonPodD1Ev.exit, label %bb2.i
20
21bb2.i: ; preds = %bb1.i
22 %4 = getelementptr %struct.Foo* %.0.i, i32 -1 ; <%struct.Foo*> [#uses=1]
23 br label %bb1.i
24
25_ZN6NonPodD1Ev.exit: ; preds = %bb1.i
26 ret void
27}
28