blob: ba2eef7095b12ae7ef64b52d12189a7df3ccd567 [file] [log] [blame]
Chris Lattner0673d472003-05-12 21:57:41 +00001; 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
Tanya Lattner6f729d62008-03-25 04:26:08 +00005; RUN: llvm-as < %s | opt -loopsimplify
6define i32 @re_match_2() {
Chris Lattner0673d472003-05-12 21:57:41 +00007 br label %loopentry.1
Tanya Lattner6f729d62008-03-25 04:26:08 +00008loopentry.1: ; preds = %endif.82, %0
Chris Lattner0673d472003-05-12 21:57:41 +00009 br label %shortcirc_done.36
Tanya Lattner6f729d62008-03-25 04:26:08 +000010shortcirc_done.36: ; preds = %loopentry.1
11 br i1 false, label %fail, label %endif.40
Chris Lattner0673d472003-05-12 21:57:41 +000012endif.40: ; preds = %shortcirc_done.36
13 br label %loopexit.20
Tanya Lattner6f729d62008-03-25 04:26:08 +000014loopentry.20: ; preds = %endif.46
Chris Lattner0673d472003-05-12 21:57:41 +000015 br label %loopexit.20
Tanya Lattner6f729d62008-03-25 04:26:08 +000016loopexit.20: ; preds = %loopentry.20, %endif.40
Chris Lattner0673d472003-05-12 21:57:41 +000017 br label %loopentry.21
Tanya Lattner6f729d62008-03-25 04:26:08 +000018loopentry.21: ; preds = %no_exit.19, %loopexit.20
19 br i1 false, label %no_exit.19, label %loopexit.21
Chris Lattner0673d472003-05-12 21:57:41 +000020no_exit.19: ; preds = %loopentry.21
Tanya Lattner6f729d62008-03-25 04:26:08 +000021 br i1 false, label %fail, label %loopentry.21
Chris Lattner0673d472003-05-12 21:57:41 +000022loopexit.21: ; preds = %loopentry.21
23 br label %endif.45
Chris Lattner0673d472003-05-12 21:57:41 +000024endif.45: ; preds = %loopexit.21
25 br label %cond_true.15
Chris Lattner0673d472003-05-12 21:57:41 +000026cond_true.15: ; preds = %endif.45
Tanya Lattner6f729d62008-03-25 04:26:08 +000027 br i1 false, label %fail, label %endif.46
Chris Lattner0673d472003-05-12 21:57:41 +000028endif.46: ; preds = %cond_true.15
29 br label %loopentry.20
Tanya Lattner6f729d62008-03-25 04:26:08 +000030fail: ; preds = %loopexit.37, %cond_true.15, %no_exit.19, %shortcirc_done.36
Chris Lattner0673d472003-05-12 21:57:41 +000031 br label %then.80
Chris Lattner0673d472003-05-12 21:57:41 +000032then.80: ; preds = %fail
33 br label %endif.81
Chris Lattner0673d472003-05-12 21:57:41 +000034endif.81: ; preds = %then.80
35 br label %loopexit.37
Chris Lattner0673d472003-05-12 21:57:41 +000036loopexit.37: ; preds = %endif.81
Tanya Lattner6f729d62008-03-25 04:26:08 +000037 br i1 false, label %fail, label %endif.82
Chris Lattner0673d472003-05-12 21:57:41 +000038endif.82: ; preds = %loopexit.37
39 br label %loopentry.1
40}
Tanya Lattner6f729d62008-03-25 04:26:08 +000041
42