Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg -disable-output && |
| 2 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail && |
| 3 | ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | grep -c pass | grep 3 |
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] |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 13 | br bool %tmp4, label %cond_true5, label %cond_false |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 14 | |
| 15 | cond_true5: ; preds = %cond_true |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 16 | %tmp6 = call int %pass( ) ; <int> [#uses=1] |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 17 | ret int %tmp6 |
| 18 | |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 19 | cond_false: |
| 20 | %tmp8 = call int %fail ( ) ; <int> [#uses=1] |
| 21 | ret int %tmp8 |
| 22 | |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 23 | return: ; preds = %cond_next7 |
| 24 | ret int 0 |
| 25 | } |
| 26 | |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame] | 27 | int %test2(int %x, int %y) { |
| 28 | entry: |
| 29 | %tmp2 = or int %x, %y ; <int> [#uses=1] |
| 30 | %tmp = setne int %tmp2, 0 ; <bool> [#uses=1] |
| 31 | br bool %tmp, label %cond_true, label %return |
| 32 | |
| 33 | cond_true: ; preds = %entry |
| 34 | %tmp4 = seteq int %x, 0 ; <bool> [#uses=1] |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 35 | br bool %tmp4, label %cond_true5, label %cond_false |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame] | 36 | |
| 37 | cond_true5: ; preds = %cond_true |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 38 | %tmp6 = call int %pass1( ) ; <int> [#uses=1] |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame] | 39 | ret int %tmp6 |
| 40 | |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 41 | cond_false: |
| 42 | %tmp8 = call int %pass2( ) ; <int> [#uses=1] |
| 43 | ret int %tmp8 |
| 44 | |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame] | 45 | return: ; preds = %cond_next7 |
| 46 | ret int 0 |
| 47 | } |
| 48 | |
Nick Lewycky | 5062250 | 2006-10-22 21:36:41 +0000 | [diff] [blame] | 49 | declare int %fail() |
Nick Lewycky | aa596f3 | 2006-10-26 00:51:58 +0000 | [diff] [blame] | 50 | declare int %pass() |
Nick Lewycky | 7a2ed81 | 2006-10-28 02:34:41 +0000 | [diff] [blame^] | 51 | declare int %pass1() |
| 52 | declare int %pass2() |