blob: 07bf0981b4c08e8abaf295cdd63fb664cab467c8 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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 -c pass | grep 3
5
6int %test1(int %x, int %y) {
7entry:
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
12cond_true: ; preds = %entry
13 %tmp4 = seteq int %x, 0 ; <bool> [#uses=1]
14 br bool %tmp4, label %cond_true5, label %cond_false
15
16cond_true5: ; preds = %cond_true
17 %tmp6 = call int %pass( ) ; <int> [#uses=1]
18 ret int %tmp6
19
20cond_false:
21 %tmp8 = call int %fail ( ) ; <int> [#uses=1]
22 ret int %tmp8
23
24return: ; preds = %cond_next7
25 ret int 0
26}
27
28int %test2(int %x, int %y) {
29entry:
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
34cond_true: ; preds = %entry
35 %tmp4 = seteq int %x, 0 ; <bool> [#uses=1]
36 br bool %tmp4, label %cond_true5, label %cond_false
37
38cond_true5: ; preds = %cond_true
39 %tmp6 = call int %pass1( ) ; <int> [#uses=1]
40 ret int %tmp6
41
42cond_false:
43 %tmp8 = call int %pass2( ) ; <int> [#uses=1]
44 ret int %tmp8
45
46return: ; preds = %cond_next7
47 ret int 0
48}
49
50declare int %fail()
51declare int %pass()
52declare int %pass1()
53declare int %pass2()