blob: 70445fb8f8c1389e7452ed353500e4d424d479fc [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This testcase exposed a problem with the loop identification pass (LoopInfo).
2; Basically, it was incorrectly calculating the loop nesting information.
3;
Tanya Lattner348c6182008-03-25 04:26:08 +00004; RUN: llvm-as < %s | opt -loopsimplify
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
Tanya Lattner348c6182008-03-25 04:26:08 +00006define i32 @yylex() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007 br label %loopentry.0
Tanya Lattner348c6182008-03-25 04:26:08 +00008loopentry.0: ; preds = %else.4, %0
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009 br label %loopexit.2
Tanya Lattner348c6182008-03-25 04:26:08 +000010loopexit.2: ; preds = %else.4, %loopexit.2, %loopentry.0
11 br i1 false, label %loopexit.2, label %else.4
12yy_find_action: ; preds = %else.4
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013 br label %else.4
Tanya Lattner348c6182008-03-25 04:26:08 +000014else.4: ; preds = %yy_find_action, %loopexit.2
15 switch i32 0, label %loopexit.2 [
16 i32 2, label %yy_find_action
17 i32 0, label %loopentry.0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018 ]
19}
Tanya Lattner348c6182008-03-25 04:26:08 +000020