Dan Gohman | f17a25c | 2007-07-18 16:29:46 +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 | |
Dan Gohman | 3c7d308 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 5 | ; RUN: opt < %s -loopsimplify |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 6 | define i32 @re_match_2() { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | br label %loopentry.1 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 8 | loopentry.1: ; preds = %endif.82, %0 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 9 | br label %shortcirc_done.36 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 10 | shortcirc_done.36: ; preds = %loopentry.1 |
| 11 | br i1 false, label %fail, label %endif.40 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 12 | endif.40: ; preds = %shortcirc_done.36 |
| 13 | br label %loopexit.20 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 14 | loopentry.20: ; preds = %endif.46 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 15 | br label %loopexit.20 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 16 | loopexit.20: ; preds = %loopentry.20, %endif.40 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 17 | br label %loopentry.21 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 18 | loopentry.21: ; preds = %no_exit.19, %loopexit.20 |
| 19 | br i1 false, label %no_exit.19, label %loopexit.21 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 20 | no_exit.19: ; preds = %loopentry.21 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 21 | br i1 false, label %fail, label %loopentry.21 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 22 | loopexit.21: ; preds = %loopentry.21 |
| 23 | br label %endif.45 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 24 | endif.45: ; preds = %loopexit.21 |
| 25 | br label %cond_true.15 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 26 | cond_true.15: ; preds = %endif.45 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 27 | br i1 false, label %fail, label %endif.46 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 28 | endif.46: ; preds = %cond_true.15 |
| 29 | br label %loopentry.20 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 30 | fail: ; preds = %loopexit.37, %cond_true.15, %no_exit.19, %shortcirc_done.36 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 31 | br label %then.80 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 32 | then.80: ; preds = %fail |
| 33 | br label %endif.81 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 34 | endif.81: ; preds = %then.80 |
| 35 | br label %loopexit.37 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 36 | loopexit.37: ; preds = %endif.81 |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 37 | br i1 false, label %fail, label %endif.82 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 38 | endif.82: ; preds = %loopexit.37 |
| 39 | br label %loopentry.1 |
| 40 | } |
Tanya Lattner | 348c618 | 2008-03-25 04:26:08 +0000 | [diff] [blame] | 41 | |
| 42 | |