xref: /llvm-project/llvm/test/Transforms/CodeExtractor/unreachable-block.ll (revision 0ca8ddd84d416b2b2b831fbc75ac8dbb77a12928)
1*0ca8ddd8SRoman Lebedev; RUN: opt -S -passes=partial-inliner %s | FileCheck %s
2cee313d2SEric Christopher
3cee313d2SEric Christopher; CHECK-LABEL: define void @dipsy(
4cee313d2SEric Christopher; CHECK-NEXT:   call void @tinkywinky.1.ontrue()
5cee313d2SEric Christopher; CHECK-NEXT:   call void @patatuccio()
6cee313d2SEric Christopher; CHECK-NEXT:   ret void
7cee313d2SEric Christopher; CHECK-NEXT: }
8cee313d2SEric Christopher
9cee313d2SEric Christopher; CHECK-LABEL: define internal void @tinkywinky.1.ontrue() {
10cee313d2SEric Christopher; CHECK-NEXT: newFuncRoot:
11cee313d2SEric Christopher; CHECK-NEXT:   br label %ontrue
12cee313d2SEric Christopher; CHECK: ontrue:
13cee313d2SEric Christopher; CHECK-NEXT:   call void @patatino()
14cee313d2SEric Christopher; CHECK-NEXT:   br label %onfalse{{.*}}
152e192ab1SVyacheslav Zakharin; CHECK: onfalse{{.*}}:
162e192ab1SVyacheslav Zakharin; CHECK-NEXT:   ret void
17cee313d2SEric Christopher; CHECK-NEXT: }
18cee313d2SEric Christopher
19cee313d2SEric Christopherdeclare void @patatino()
20cee313d2SEric Christopherdeclare void @patatuccio()
21cee313d2SEric Christopher
22cee313d2SEric Christopherdefine fastcc void @tinkywinky() {
23cee313d2SEric Christopher  br i1 true, label %ontrue, label %onfalse
24cee313d2SEric Christopherontrue:
25cee313d2SEric Christopher  call void @patatino()
26cee313d2SEric Christopher  br label %onfalse
27cee313d2SEric Christopheronfalse:
28cee313d2SEric Christopher  call void @patatuccio()
29cee313d2SEric Christopher  ret void
30cee313d2SEric Christophercantreachme:
31cee313d2SEric Christopher  ret void
32cee313d2SEric Christopher}
33cee313d2SEric Christopherdefine void @dipsy() {
34cee313d2SEric Christopher  call fastcc void @tinkywinky()
35cee313d2SEric Christopher  ret void
36cee313d2SEric Christopher}
37