1; RUN: opt -codegenprepare -S %s -o - | FileCheck %s
2target triple = "thumbv7-apple-ios7.0.0"
3
4
5%struct = type [1000 x i32]
6
7define void @test_dead_gep(%struct* %t0) {
8; CHECK-LABEL: define void @test_dead_gep
9; CHECK-NOT: getelementptr
10; CHECK: %t16 = load i32, i32* undef
11; CHECK: ret void
12
13  %t12 = getelementptr inbounds %struct, %struct* %t0, i32 1, i32 500
14  %t13 = load i32, i32* %t12, align 4
15  %t14 = icmp eq i32 %t13, 2
16  %t15 = select i1 %t14, i32* undef, i32* undef
17  %t16 = load i32, i32* %t15, align 4
18  ret void
19}
20