Add the SCCP regression tests for APInt expressions. These test cases
[oota-llvm.git] / test / Transforms / SCCP / apint-basictest2.ll
1 ; This is a basic sanity check for constant propogation.  The add instruction 
2 ; and phi instruction should be eliminated.
3
4 ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f &&
5 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi
6 ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add
7
8 define i128 @test(i1 %B) {
9         br i1 %B, label %BB1, label %BB2
10 BB1:
11         %Val = add i128 0, 1
12         br label %BB3
13 BB2:
14         br label %BB3
15 BB3:
16         %Ret = phi i128 [%Val, %BB1], [1, %BB2]
17         ret i128 %Ret
18 }