Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg && |
| 2 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c fail | grep 1 && |
| 3 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 1 |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 4 | |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame^] | 5 | int %test1(int %x, int %y) { |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 6 | entry: |
| 7 | %tmp2 = or int %x, %y ; <int> [#uses=1] |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame^] | 8 | %tmp = seteq int %tmp2, 0 ; <bool> [#uses=1] |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 9 | br bool %tmp, label %cond_true, label %return |
| 10 | |
| 11 | cond_true: ; preds = %entry |
| 12 | %tmp4 = seteq int %x, 0 ; <bool> [#uses=1] |
| 13 | br bool %tmp4, label %cond_true5, label %return |
| 14 | |
| 15 | cond_true5: ; preds = %cond_true |
| 16 | %tmp6 = call int %fail( ) ; <int> [#uses=0] |
| 17 | ret int %tmp6 |
| 18 | |
| 19 | return: ; preds = %cond_next7 |
| 20 | ret int 0 |
| 21 | } |
| 22 | |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame^] | 23 | int %test2(int %x, int %y) { |
| 24 | entry: |
| 25 | %tmp2 = or int %x, %y ; <int> [#uses=1] |
| 26 | %tmp = setne int %tmp2, 0 ; <bool> [#uses=1] |
| 27 | br bool %tmp, label %cond_true, label %return |
| 28 | |
| 29 | cond_true: ; preds = %entry |
| 30 | %tmp4 = seteq int %x, 0 ; <bool> [#uses=1] |
| 31 | br bool %tmp4, label %cond_true5, label %return |
| 32 | |
| 33 | cond_true5: ; preds = %cond_true |
| 34 | %tmp6 = call int %pass( ) ; <int> [#uses=0] |
| 35 | ret int %tmp6 |
| 36 | |
| 37 | return: ; preds = %cond_next7 |
| 38 | ret int 0 |
| 39 | } |
| 40 | |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 41 | declare int %fail() |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame^] | 42 | declare int %pass() |