Update the inliner and simplifycfg to handle unwind_to.
[oota-llvm.git] / test / Transforms / SimplifyCFG / unwindto.ll
1 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep unwind_to | count 3
2
3 declare void @g(i32)
4
5 define i32 @f1() {
6 entry:
7   br label %bb1
8 bb1: unwind_to %cleanup1
9   call void @g(i32 0)
10   br label %bb2
11 bb2: unwind_to %cleanup2
12   call void @g(i32 1)
13   br label %exit
14 exit:
15   ret i32 0
16 cleanup1:
17   ret i32 1
18 cleanup2:
19   ret i32 2
20 }
21
22 define i32 @f2() {
23 entry: unwind_to %cleanup
24   br label %bb1
25 bb1: unwind_to %cleanup
26   br label %bb2
27 bb2: unwind_to %cleanup
28   br label %bb3
29 bb3:
30   br label %bb4
31 bb4: unwind_to %cleanup
32   ret i32 0
33 cleanup:
34   ret i32 1
35 }