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 | |
Dan Gohman | f2f6ce6 | 2009-09-11 18:01:28 +0000 | [diff] [blame^] | 5 | ; RUN: opt < %s -sccp -S | not grep mul |
| 6 | ; RUN: opt < %s -sccp -S | not grep umod |
Reid Spencer | c6b9efa | 2007-04-13 22:33:10 +0000 | [diff] [blame] | 7 | |
| 8 | define i128 @test(i1 %B) { |
| 9 | br i1 %B, label %BB1, label %BB2 |
| 10 | BB1: |
| 11 | %t1 = add i128 0, 1 |
| 12 | %t2 = sub i128 0, %t1 |
| 13 | %t3 = mul i128 %t2, -1 |
| 14 | br label %BB3 |
| 15 | BB2: |
| 16 | %f1 = udiv i128 -1, 1 |
| 17 | %f2 = add i128 %f1, 1 |
Reid Spencer | 9aafdcf | 2007-04-15 09:21:47 +0000 | [diff] [blame] | 18 | %f3 = urem i128 %f2, 2121 |
Reid Spencer | c6b9efa | 2007-04-13 22:33:10 +0000 | [diff] [blame] | 19 | br label %BB3 |
| 20 | BB3: |
| 21 | %Ret = phi i128 [%t3, %BB1], [%f3, %BB2] |
| 22 | ret i128 %Ret |
| 23 | } |