blob: 92d7cad770dc88dd49308fcec333a1f26770450c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; THis testcase caused an assertion failure because a PHI node did not have
2; entries for it's postdominator. But I think this can only happen when the
3; PHI node is dead, so we just avoid patching up dead PHI nodes.
4
5; RUN: llvm-upgrade < %s | llvm-as | opt -adce
6
7target endian = little
8target pointersize = 32
9
10implementation ; Functions:
11
12void %dead_test8() {
13entry: ; No predecessors!
14 br label %loopentry
15
16loopentry: ; preds = %entry, %endif
17 %k.1 = phi int [ %k.0, %endif ], [ 0, %entry ] ; <int> [#uses=1]
18 br bool false, label %no_exit, label %return
19
20no_exit: ; preds = %loopentry
21 br bool false, label %then, label %else
22
23then: ; preds = %no_exit
24 br label %endif
25
26else: ; preds = %no_exit
27 %dec = add int %k.1, -1 ; <int> [#uses=1]
28 br label %endif
29
30endif: ; preds = %else, %then
31 %k.0 = phi int [ %dec, %else ], [ 0, %then ] ; <int> [#uses=1]
32 store int 2, int* null
33 br label %loopentry
34
35return: ; preds = %loopentry
36 ret void
37}