blob: 6e86764bf2cff84c8a96630f41dbf7207484f5d0 [file] [log] [blame]
Reid Spencerc6b9efa2007-04-13 22:33:10 +00001; This is a basic sanity check for constant propogation. It tests the basic
2; arithmatic operations.
3
4
Reid Spencerc6b9efa2007-04-13 22:33:10 +00005; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep mul
6; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep umod
7
8define i128 @test(i1 %B) {
9 br i1 %B, label %BB1, label %BB2
10BB1:
11 %t1 = add i128 0, 1
12 %t2 = sub i128 0, %t1
13 %t3 = mul i128 %t2, -1
14 br label %BB3
15BB2:
16 %f1 = udiv i128 -1, 1
17 %f2 = add i128 %f1, 1
Reid Spencer9aafdcf2007-04-15 09:21:47 +000018 %f3 = urem i128 %f2, 2121
Reid Spencerc6b9efa2007-04-13 22:33:10 +000019 br label %BB3
20BB3:
21 %Ret = phi i128 [%t3, %BB1], [%f3, %BB2]
22 ret i128 %Ret
23}