blob: 63fa33a95830837ce6cf5b517559966a885abdfd [file] [log] [blame]
Chris Lattner5fdd9022003-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
5; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
6
7int %test(bool %C) {
8 br label %Loop
9Loop:
10 %IV = phi uint [0, %0], [%IV2, %BE1], [%IV2, %BE2]
11 %IV2 = add uint %IV, 2
12 br bool %C, label %BE1, label %BE2
13BE1:
14 br label %Loop
15BE2:
16 br label %Loop
17}