1 ; RUN: opt < %s -sccp -S | FileCheck %s
3 @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,
4 i101 -123456789000000, i101 0,i101 9123456789000000]
7 ; CHECK-NEXT: ret i101 123456789000000
9 %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1
10 %B = load i101, i101* %A
13 %E = trunc i101 %DD to i32
14 %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E
15 %G = load i101, i101* %F
20 ; CHECK-LABEL: @large_aggregate
21 ; CHECK-NEXT: ret i101 undef
22 define i101 @large_aggregate() {
23 %B = load i101, i101* undef
26 %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 5
27 %G = getelementptr i101, i101* %F, i101 %DD
28 %L3 = load i101, i101* %G
32 ; CHECK-LABEL: @index_too_large
33 ; CHECK-NEXT: store i101* getelementptr (i101, i101* getelementptr ([6 x i101], [6 x i101]* @Y, i32 0, i32 -1), i101 9224497936761618431), i101** undef
34 ; CHECK-NEXT: ret void
35 define void @index_too_large() {
36 %ptr1 = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 -1
37 %ptr2 = getelementptr i101, i101* %ptr1, i101 9224497936761618431
38 store i101* %ptr2, i101** undef