Fix bug in updating dominance frontier after loop
[oota-llvm.git] / test / Transforms / PredicateSimplifier / 2006-10-22-IntOr.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | \
2 ; RUN:   opt -predsimplify -instcombine -simplifycfg  | llvm-dis > %t
3 ; RUN: grep -v declare %t | not grep fail
4 ; RUN: grep -v declare %t | grep pass | count 3
5
6 int %test1(int %x, int %y) {
7 entry:
8         %tmp2 = or int %x, %y           ; <int> [#uses=1]
9         %tmp = seteq int %tmp2, 0               ; <bool> [#uses=1]
10         br bool %tmp, label %cond_true, label %return
11
12 cond_true:              ; preds = %entry
13         %tmp4 = seteq int %x, 0         ; <bool> [#uses=1]
14         br bool %tmp4, label %cond_true5, label %cond_false
15
16 cond_true5:             ; preds = %cond_true
17         %tmp6 = call int %pass( )               ; <int> [#uses=1]
18         ret int %tmp6
19
20 cond_false:
21         %tmp8 = call int %fail ( )              ; <int> [#uses=1]
22         ret int %tmp8
23
24 return:         ; preds = %cond_next7
25         ret int 0
26 }
27
28 int %test2(int %x, int %y) {
29 entry:
30         %tmp2 = or int %x, %y           ; <int> [#uses=1]
31         %tmp = setne int %tmp2, 0               ; <bool> [#uses=1]
32         br bool %tmp, label %cond_true, label %return
33
34 cond_true:              ; preds = %entry
35         %tmp4 = seteq int %x, 0         ; <bool> [#uses=1]
36         br bool %tmp4, label %cond_true5, label %cond_false
37
38 cond_true5:             ; preds = %cond_true
39         %tmp6 = call int %pass1( )              ; <int> [#uses=1]
40         ret int %tmp6
41
42 cond_false:
43         %tmp8 = call int %pass2( )              ; <int> [#uses=1]
44         ret int %tmp8
45
46 return:         ; preds = %cond_next7
47         ret int 0
48 }
49
50 declare int %fail()
51 declare int %pass()
52 declare int %pass1()
53 declare int %pass2()