Dan Gohman | 3c7d308 | 2009-09-11 18:01:28 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -ipsccp -S | grep -v {ret i512 undef} | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 2 | ; RUN: grep {ret i8 2} |
| 3 | |
| 4 | define internal i512 @test(i1 %B) { |
| 5 | br i1 %B, label %BB1, label %BB2 |
| 6 | BB1: |
| 7 | %Val = add i512 0, 1 |
| 8 | br label %BB3 |
| 9 | BB2: |
| 10 | br label %BB3 |
| 11 | BB3: |
| 12 | %Ret = phi i512 [%Val, %BB1], [2, %BB2] |
| 13 | ret i512 %Ret |
| 14 | } |
| 15 | |
| 16 | define i8 @caller() |
| 17 | { |
| 18 | %t1 = and i2 2, 1 |
| 19 | %t11 = trunc i2 %t1 to i1 |
| 20 | %t2 = call i512 @test(i1 %t11) |
| 21 | %t3 = trunc i512 %t2 to i8 |
| 22 | ret i8 %t3 |
| 23 | } |
| 24 | |