1 ; RUN: opt < %s -S -passes=instcombine | FileCheck %s
2 ; rdar://problem/9267970
3 ; ideally this test will run on a 32-bit host
4 ; must not discard GEPs that might overflow at runtime (aren't inbounds)
6 define i32 @main(i32 %argc) {
8 %tmp1 = add i32 %argc, -2
9 %tmp2 = add i32 %argc, 1879048192
11 ; CHECK: getelementptr
12 %p1 = getelementptr i8, ptr %p, i32 %tmp1
13 ; CHECK: getelementptr
14 %p2 = getelementptr i8, ptr %p, i32 %tmp2
15 %cmp = icmp ult ptr %p1, %p2
16 br i1 %cmp, label %bbtrue, label %bbfalse
17 bbtrue: ; preds = %entry
19 bbfalse: ; preds = %entry