blob: 53a6ffbf9823d2f516a265df7f32974db5ee0213 [file] [log] [blame]
Chris Lattner3e537002003-10-12 22:26:42 +00001; The loop canonicalization pass should guarantee that there is one backedge
2; for all loops. This allows the -indvars pass to recognize the %IV
3; induction variable in this testcase.
4
Reid Spencerd0e30dc2006-12-02 04:23:10 +00005; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep indvar
Chris Lattner3e537002003-10-12 22:26:42 +00006
7int %test(bool %C) {
8 br label %Loop
9Loop:
Chris Lattnerc3ad6e02003-10-13 03:31:42 +000010 %IV = phi uint [1, %0], [%IV2, %BE1], [%IV2, %BE2]
Chris Lattner3e537002003-10-12 22:26:42 +000011 %IV2 = add uint %IV, 2
12 br bool %C, label %BE1, label %BE2
13BE1:
14 br label %Loop
15BE2:
16 br label %Loop
17}