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