Teach masked value is zero about add and sub, and use MVIZ to
[oota-llvm.git] / test / Transforms / SimplifyCFG / unwindto.ll
1 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep {unwinds to} | count 3
2
3 declare void @g(i32)
4
5 define i32 @f1() {
6 entry:
7   br label %bb1
8 bb1: unwinds to %cleanup1
9   call void @g(i32 0)
10   br label %bb2
11 bb2: unwinds 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: unwinds to %cleanup
24   br label %bb1
25 bb1: unwinds to %cleanup
26   br label %bb2
27 bb2: unwinds to %cleanup
28   br label %bb3
29 bb3:
30   br label %bb4
31 bb4: unwinds to %cleanup
32   ret i32 0
33 cleanup:
34   ret i32 1
35 }
36
37 define i32 @f3() {
38 entry: unwinds to %cleanup
39   call void @g(i32 0)
40   ret i32 0
41 cleanup:
42   unwind
43 }
44
45 define i32 @f4() {
46 entry: unwinds to %cleanup
47   call void @g(i32 0)
48   br label %cleanup
49 cleanup:
50   unwind
51 }
52
53 define i32 @f5() {
54 entry: unwinds to %cleanup
55   call void @g(i32 0)
56   br label %other
57 other:
58   ret i32 0
59 cleanup:
60   unwind
61 }