blob: cbc54bee21bc6c6f45bac9cb2f67fdf1b69c29d4 [file] [log] [blame]
Tanya Lattner97b38e12008-03-19 05:39:35 +00001; RUN: llvm-as < %s | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis | \
Dan Gohman552fb262007-08-15 13:49:33 +00003; RUN: grep -v declare | grep pass | count 2
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner97b38e12008-03-19 05:39:35 +00005define i32 @test(i32 %x, i32 %y) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006entry:
Tanya Lattner97b38e12008-03-19 05:39:35 +00007 %tmp2 = icmp slt i32 %x, %y ; <i1> [#uses=1]
8 %tmp = icmp ne i1 %tmp2, true ; <i1> [#uses=1]
9 br i1 %tmp, label %cond_true, label %return
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010cond_true: ; preds = %entry
Tanya Lattner97b38e12008-03-19 05:39:35 +000011 %tmp4 = icmp eq i32 %x, %y ; <i1> [#uses=1]
12 br i1 %tmp4, label %cond_true5, label %cond_false
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013cond_true5: ; preds = %cond_true
Tanya Lattner97b38e12008-03-19 05:39:35 +000014 %tmp6 = call i32 @pass1( ) ; <i32> [#uses=1]
15 ret i32 %tmp6
16cond_false: ; preds = %cond_true
17 %tmp8 = call i32 @pass2( ) ; <i32> [#uses=1]
18 ret i32 %tmp8
19return: ; preds = %entry
20 ret i32 0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021}
22
Tanya Lattner97b38e12008-03-19 05:39:35 +000023declare i32 @pass1()
24
25declare i32 @pass2()
26