Convert more tests to avoid llvm-as.
[oota-llvm.git] / test / Transforms / PredicateSimplifier / 2006-10-22-IntOr.ll
1 ; RUN: opt < %s -predsimplify -instcombine -simplifycfg -S > %t
2 ; RUN: grep -v declare %t | not grep fail
3 ; RUN: grep -v declare %t | grep pass | count 3
4
5 define i32 @test1(i32 %x, i32 %y) {
6 entry:
7         %tmp2 = or i32 %x, %y           ; <i32> [#uses=1]
8         %tmp = icmp eq i32 %tmp2, 0             ; <i1> [#uses=1]
9         br i1 %tmp, label %cond_true, label %return
10 cond_true:              ; preds = %entry
11         %tmp4 = icmp eq i32 %x, 0               ; <i1> [#uses=1]
12         br i1 %tmp4, label %cond_true5, label %cond_false
13 cond_true5:             ; preds = %cond_true
14         %tmp6 = call i32 @pass( )               ; <i32> [#uses=1]
15         ret i32 %tmp6
16 cond_false:             ; preds = %cond_true
17         %tmp8 = call i32 @fail( )               ; <i32> [#uses=1]
18         ret i32 %tmp8
19 return:         ; preds = %entry
20         ret i32 0
21 }
22
23 define i32 @test2(i32 %x, i32 %y) {
24 entry:
25         %tmp2 = or i32 %x, %y           ; <i32> [#uses=1]
26         %tmp = icmp ne i32 %tmp2, 0             ; <i1> [#uses=1]
27         br i1 %tmp, label %cond_true, label %return
28 cond_true:              ; preds = %entry
29         %tmp4 = icmp eq i32 %x, 0               ; <i1> [#uses=1]
30         br i1 %tmp4, label %cond_true5, label %cond_false
31 cond_true5:             ; preds = %cond_true
32         %tmp6 = call i32 @pass1( )              ; <i32> [#uses=1]
33         ret i32 %tmp6
34 cond_false:             ; preds = %cond_true
35         %tmp8 = call i32 @pass2( )              ; <i32> [#uses=1]
36         ret i32 %tmp8
37 return:         ; preds = %entry
38         ret i32 0
39 }
40
41 declare i32 @fail()
42
43 declare i32 @pass()
44
45 declare i32 @pass1()
46
47 declare i32 @pass2()