blob: 541412bf86b02b4ade7f0659c9339c910b9b786d [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This is a basic sanity check for constant propogation. It tests the basic
2; logic operations.
3
4
Dan Gohman1b4c27772009-09-08 16:50:01 +00005; RUN: opt %s -sccp | llvm-dis | not grep and
6; RUN: opt %s -sccp | llvm-dis | not grep trunc
7; RUN: opt %s -sccp | llvm-dis | grep {ret i100 -1}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
9define i100 @test(i133 %A) {
10 %B = and i133 0, %A
11 %C = icmp sgt i133 %B, 0
12 br i1 %C, label %BB1, label %BB2
13BB1:
14 %t3 = xor i133 %B, -1
15 %t4 = trunc i133 %t3 to i100
16 br label %BB3
17BB2:
18 %f1 = or i133 -1, %A
19 %f2 = lshr i133 %f1, 33
20 %f3 = trunc i133 %f2 to i100
21 br label %BB3
22BB3:
23 %Ret = phi i100 [%t4, %BB1], [%f3, %BB2]
24 ret i100 %Ret
25}