Add the SCCP regression tests for APInt expressions. These test cases
[oota-llvm.git] / test / Transforms / SCCP / apint-ipsccp1.ll
1 ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v 'ret i512 undef' | grep 'ret i8 2'
2
3 define internal i512 @test(i1 %B) {
4         br i1 %B, label %BB1, label %BB2
5 BB1:
6         %Val = add i512 0, 1
7         br label %BB3
8 BB2:
9         br label %BB3
10 BB3:
11         %Ret = phi i512 [%Val, %BB1], [2, %BB2]
12         ret i512 %Ret
13 }
14
15 define i8 @caller()
16 {
17     %t1 = and i2 2, 1
18     %t11 = trunc i2 %t1 to i1
19     %t2 = call i512 @test(i1 %t11)
20     %t3 = trunc i512 %t2 to i8
21     ret i8 %t3
22 }
23