blob: 7632034e13b5ad18e1912c888658570414019e28 [file] [log] [blame]
Eli Friedman2a019462011-07-13 21:29:53 +00001; RUN: llc -march=x86-64 < %s -disable-fp-elim | FileCheck %s
2
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>
6
7declare void @bar([39 x i8]*)
8define i32 @f(i64 %a, i64 %b) nounwind readnone {
9entry:
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]* %stack_main, i64 0, i64 %.sum
15 %tmp9 = load i8* %tmp8, align 1
16 %tmp10 = sext i8 %tmp9 to i32
17 ret i32 %tmp10
18}
19; CHECK: f:
20; CHECK: movsbl -2147483647