Chris Lattner | 0673d47 | 2003-05-12 21:57:41 +0000 | [diff] [blame] | 1 | ; This (complex) testcase causes an assertion failure because a preheader is |
| 2 | ; inserted for the "fail" loop, but the exit block of a loop is not updated |
| 3 | ; to be the preheader instead of the exit loop itself. |
| 4 | |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame^] | 5 | ; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify |
Chris Lattner | 0673d47 | 2003-05-12 21:57:41 +0000 | [diff] [blame] | 6 | |
| 7 | int %re_match_2() { |
| 8 | br label %loopentry.1 |
| 9 | |
| 10 | loopentry.1: ; preds = %then.6, %endif.7, %loopexit.20, %endif.83 |
| 11 | br label %shortcirc_done.36 |
| 12 | |
| 13 | shortcirc_done.36: ; preds = %label.13, %shortcirc_next.36 |
| 14 | br bool false, label %fail, label %endif.40 |
| 15 | |
| 16 | endif.40: ; preds = %shortcirc_done.36 |
| 17 | br label %loopexit.20 |
| 18 | |
| 19 | loopentry.20: ; preds = %shortcirc_done.40, %endif.46 |
| 20 | br label %loopexit.20 |
| 21 | |
| 22 | loopexit.20: ; preds = %loopentry.20 |
| 23 | br label %loopentry.21 |
| 24 | |
| 25 | loopentry.21: ; preds = %loopexit.20, %no_exit.19 |
| 26 | br bool false, label %no_exit.19, label %loopexit.21 |
| 27 | |
| 28 | no_exit.19: ; preds = %loopentry.21 |
| 29 | br bool false, label %fail, label %loopentry.21 |
| 30 | |
| 31 | loopexit.21: ; preds = %loopentry.21 |
| 32 | br label %endif.45 |
| 33 | |
| 34 | endif.45: ; preds = %loopexit.21 |
| 35 | br label %cond_true.15 |
| 36 | |
| 37 | cond_true.15: ; preds = %endif.45 |
| 38 | br bool false, label %fail, label %endif.46 |
| 39 | |
| 40 | endif.46: ; preds = %cond_true.15 |
| 41 | br label %loopentry.20 |
| 42 | |
| 43 | fail: ; preds = %shortcirc_done.36, %loopexit.37, %cond_true.15, %no_exit.19 |
| 44 | br label %then.80 |
| 45 | |
| 46 | then.80: ; preds = %fail |
| 47 | br label %endif.81 |
| 48 | |
| 49 | endif.81: ; preds = %then.80 |
| 50 | br label %loopexit.37 |
| 51 | |
| 52 | loopexit.37: ; preds = %endif.81 |
| 53 | br bool false, label %fail, label %endif.82 |
| 54 | |
| 55 | endif.82: ; preds = %loopexit.37 |
| 56 | br label %loopentry.1 |
| 57 | } |