1 ; When constant propogating terminator instructions, the basic block iterator
2 ; was not updated to refer to the final position of the new terminator. This
3 ; can be bad, f.e. because constproping a terminator can lead to the
4 ; destruction of PHI nodes, which invalidates the iterator!
6 ; Fixed by adding new arguments to ConstantFoldTerminator
8 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop
12 void "build_tree"(int %ml)
17 %reg137 = phi int [ %reg140, %bb2 ], [ 12, %0 ] ; <int> [#uses=2]
18 %reg138 = phi uint [ %reg139, %bb2 ], [ 0, %0 ] ; <uint> [#uses=3]
19 %reg139 = add uint %reg138, 1 ; <uint> [#uses=1]
20 %reg140 = add int %reg137, -1 ; <int> [#uses=1]
21 br bool false, label %bb2, label %bb3