blob: 1e75878f3aeb5675063f7e30b4e63ebc65ffec75 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -sccp -S | grep {ret i101 12}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
3@Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,i101
4-123456789000000, i101 0,i101 9123456789000000]
5
6define i101 @array()
7{
8Head:
9 %A = getelementptr [6 x i101]* @Y, i32 0, i32 1
10
11 %B = load i101* %A
12 %C = icmp sge i101 %B, 1
13 br i1 %C, label %True, label %False
14True:
15 %D = and i101 %B, 1
16 %E = trunc i101 %D to i32
17 %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E
18 %G = load i101* %F
19 br label %False
20False:
21 %H = phi i101 [%G, %True], [-1, %Head]
22 ret i101 %H
23}