xref: /llvm-project/llvm/test/Transforms/SCCP/apint-basictest2.ll (revision 8ebb3eac02a926ffa4298c12834c57aefb2e8579)
17f7dac71SZarko Todorovski; This is a basic correctness check for constant propagation.  The add
27f7dac71SZarko Todorovski; instruction and phi instruction should be eliminated.
3cee313d2SEric Christopher
4*8ebb3eacSBjorn Pettersson; RUN: opt < %s -passes=sccp -S | not grep phi
5*8ebb3eacSBjorn Pettersson; RUN: opt < %s -passes=sccp -S | not grep add
6cee313d2SEric Christopher
7cee313d2SEric Christopherdefine i128 @test(i1 %B) {
8cee313d2SEric Christopher	br i1 %B, label %BB1, label %BB2
9cee313d2SEric ChristopherBB1:
10cee313d2SEric Christopher	%Val = add i128 0, 1
11cee313d2SEric Christopher	br label %BB3
12cee313d2SEric ChristopherBB2:
13cee313d2SEric Christopher	br label %BB3
14cee313d2SEric ChristopherBB3:
15cee313d2SEric Christopher	%Ret = phi i128 [%Val, %BB1], [1, %BB2]
16cee313d2SEric Christopher	ret i128 %Ret
17cee313d2SEric Christopher}
18