blob: 144f646fe08158d84376d9c3fdb509c106dab89e [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
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
9define i128 @test(i1 %B) {
10 br i1 %B, label %BB1, label %BB2
11BB1:
12 %t1 = add i128 0, 1
13 %t2 = sub i128 0, %t1
14 %t3 = mul i128 %t2, -1
15 br label %BB3
16BB2:
17 %f1 = udiv i128 -1, 1
18 %f2 = add i128 %f1, 1
19 %f3 = umod i128 %f2, 2121
20 br label %BB3
21BB3:
22 %Ret = phi i128 [%t3, %BB1], [%f3, %BB2]
23 ret i128 %Ret
24}