1 ; RUN: llc -mtriple=x86_64-- < %s -frame-pointer=all | FileCheck %s
3 ; This test is checking that we don't crash and we don't incorrectly fold
4 ; a large displacement and a frame index into a single lea.
5 ; <rdar://problem/9763308>
7 declare void @bar([39 x i8]*)
8 define i32 @f(i64 %a, i64 %b) nounwind readnone {
10 %stack_main = alloca [39 x i8]
11 call void @bar([39 x i8]* %stack_main)
12 %tmp6 = add i64 %a, -2147483647
13 %.sum = add i64 %tmp6, %b
14 %tmp8 = getelementptr inbounds [39 x i8], [39 x i8]* %stack_main, i64 0, i64 %.sum
15 %tmp9 = load i8, i8* %tmp8, align 1
16 %tmp10 = sext i8 %tmp9 to i32
20 ; CHECK: movsbl -2147483647