Reid Spencer | c6b9efa | 2007-04-13 22:33:10 +0000 | [diff] [blame^] | 1 | ; This is a basic sanity check for constant propogation. It tests the basic |
| 2 | ; arithmatic operations. |
| 3 | |
| 4 | |
| 5 | ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && |
| 6 | ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep mul |
| 7 | ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep umod |
| 8 | |
| 9 | define i128 @test(i1 %B) { |
| 10 | br i1 %B, label %BB1, label %BB2 |
| 11 | BB1: |
| 12 | %t1 = add i128 0, 1 |
| 13 | %t2 = sub i128 0, %t1 |
| 14 | %t3 = mul i128 %t2, -1 |
| 15 | br label %BB3 |
| 16 | BB2: |
| 17 | %f1 = udiv i128 -1, 1 |
| 18 | %f2 = add i128 %f1, 1 |
| 19 | %f3 = umod i128 %f2, 2121 |
| 20 | br label %BB3 |
| 21 | BB3: |
| 22 | %Ret = phi i128 [%t3, %BB1], [%f3, %BB2] |
| 23 | ret i128 %Ret |
| 24 | } |