Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; This is a basic sanity check for constant propogation. The add instruction |
| 2 | ; should be eliminated. |
| 3 | |
Dan Gohman | 5bb7c7c | 2009-09-08 22:34:10 +0000 | [diff] [blame] | 4 | ; RUN: opt < %s -constprop -die -S | not grep phi |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 5 | |
Tanya Lattner | 4c4d0b8 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 6 | define i32 @test(i1 %B) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | BB0: |
Tanya Lattner | 4c4d0b8 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 8 | br i1 %B, label %BB1, label %BB3 |
| 9 | |
| 10 | BB1: ; preds = %BB0 |
| 11 | br label %BB3 |
| 12 | |
| 13 | BB3: ; preds = %BB1, %BB0 |
| 14 | %Ret = phi i32 [ 1, %BB0 ], [ 1, %BB1 ] ; <i32> [#uses=1] |
| 15 | ret i32 %Ret |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 16 | } |
Tanya Lattner | 4c4d0b8 | 2008-03-01 09:15:35 +0000 | [diff] [blame] | 17 | |