blob: e6139c5e09443a12f88b971986947135cba4c7ef [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; logic 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 and
7; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep trunc
8; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep "ret i100 -1"
9
10define i100 @test(i133 %A) {
11 %B = and i133 0, %A
12 %C = icmp sgt i133 %B, 0
13 br i1 %C, label %BB1, label %BB2
14BB1:
15 %t3 = xor i133 %B, -1
16 %t4 = trunc i133 %t3 to i100
17 br label %BB3
18BB2:
19 %f1 = or i133 -1, %A
20 %f2 = lshr i133 %f1, 33
21 %f3 = trunc i133 %f2 to i100
22 br label %BB3
23BB3:
24 %Ret = phi i100 [%t4, %BB1], [%f3, %BB2]
25 ret i100 %Ret
26}