1 ; RUN: opt < %s -passes='cgscc(inline,loop-simplify),loop-extract' -S | FileCheck %s
2 ; RUN: opt < %s -passes='cgscc(argpromotion,loop-simplify),loop-extract' -S | FileCheck %s
4 ; This test used to trigger an assert (PR8929).
7 ; CHECK-LABEL: define void @test()
9 ; CHECK-NEXT: br label %codeRepl
11 ; CHECK-NEXT: call void @test.loopentry()
12 ; CHECK-NEXT: br label %loopexit
14 ; CHECK-NEXT: br label %exit
16 ; CHECK-NEXT: ret void
21 loopentry: ; preds = %loopbody, %entry
22 br i1 undef, label %loopbody, label %loopexit
24 loopbody: ; preds = %codeRepl1
28 loopexit: ; preds = %codeRepl
31 exit: ; preds = %loopexit
37 ; CHECK-LABEL: define internal void @test.loopentry()
38 ; CHECK-NEXT: newFuncRoot:
39 ; CHECK-NEXT: br label %loopentry
41 ; CHECK-NEXT: br i1 false, label %loopbody, label %loopexit.exitStub
43 ; CHECK-NEXT: call void @foo()
44 ; CHECK-NEXT: br label %loopentry
45 ; CHECK: loopexit.exitStub:
46 ; CHECK-NEXT: ret void