Skip to content

Commit 49f9946

Browse files
committed
[nfc] Add regression test for large offsets in X86 ISel
1 parent 1fa0036 commit 49f9946

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -mtriple=i386-pc-windows-msvc | FileCheck %s
3+
4+
define dso_local noundef i32 @foo(i1 %b) local_unnamed_addr #0 {
5+
; CHECK-LABEL: foo:
6+
; CHECK: # %bb.0: # %entry
7+
; CHECK-NEXT: pushl %ebp
8+
; CHECK-NEXT: movl %esp, %ebp
9+
; CHECK-NEXT: pushl %esi
10+
; CHECK-NEXT: subl $8, %esp
11+
; CHECK-NEXT: movl ___security_cookie, %eax
12+
; CHECK-NEXT: xorl %ebp, %eax
13+
; CHECK-NEXT: movl %eax, -8(%ebp)
14+
; CHECK-NEXT: leal 2147483640(%ebp), %eax
15+
; CHECK-NEXT: xorl %esi, %esi
16+
; CHECK-NEXT: testb $1, 8(%ebp)
17+
; CHECK-NEXT: cmovnel %eax, %esi
18+
; CHECK-NEXT: movl -8(%ebp), %ecx
19+
; CHECK-NEXT: xorl %ebp, %ecx
20+
; CHECK-NEXT: calll @__security_check_cookie@4
21+
; CHECK-NEXT: movl %esi, %eax
22+
; CHECK-NEXT: addl $8, %esp
23+
; CHECK-NEXT: popl %esi
24+
; CHECK-NEXT: popl %ebp
25+
; CHECK-NEXT: retl
26+
entry:
27+
%a = alloca i8, align 1
28+
%0 = ptrtoint ptr %a to i32
29+
%sub = add i32 %0, -2147483647
30+
%retval.0 = select i1 %b, i32 %sub, i32 0
31+
ret i32 %retval.0
32+
}
33+
34+
attributes #0 = { mustprogress nofree norecurse nosync nounwind sspreq willreturn memory(none) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

0 commit comments

Comments
 (0)