blob: 7b6890b90ba8c473e71ea2cef79e6279b6f78c3c [file] [log] [blame]
Reid Spencerc6b9efa2007-04-13 22:33:10 +00001; 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
8define i128 @test(i1 %B) {
9 br i1 %B, label %BB1, label %BB2
10BB1:
11 %Val = add i128 0, 1
12 br label %BB3
13BB2:
14 br label %BB3
15BB3:
16 %Ret = phi i128 [%Val, %BB1], [1, %BB2]
17 ret i128 %Ret
18}