1 ; RUN: llvm-as < %s | \
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
6 define i32 @test1(i32 %x, i32 %y) {
8 %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
9 %tmp = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
10 br i1 %tmp, label %cond_true, label %return
11 cond_true: ; preds = %entry
12 %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
13 br i1 %tmp4, label %cond_true5, label %cond_false
14 cond_true5: ; preds = %cond_true
15 %tmp6 = call i32 @pass( ) ; <i32> [#uses=1]
17 cond_false: ; preds = %cond_true
18 %tmp8 = call i32 @fail( ) ; <i32> [#uses=1]
20 return: ; preds = %entry
24 define i32 @test2(i32 %x, i32 %y) {
26 %tmp2 = or i32 %x, %y ; <i32> [#uses=1]
27 %tmp = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1]
28 br i1 %tmp, label %cond_true, label %return
29 cond_true: ; preds = %entry
30 %tmp4 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
31 br i1 %tmp4, label %cond_true5, label %cond_false
32 cond_true5: ; preds = %cond_true
33 %tmp6 = call i32 @pass1( ) ; <i32> [#uses=1]
35 cond_false: ; preds = %cond_true
36 %tmp8 = call i32 @pass2( ) ; <i32> [#uses=1]
38 return: ; preds = %entry