1; RUN: llc -mtriple=x86_64-linux-android < %s | FileCheck -check-prefix=CHECK-X86-64 %s
2; RUN: llc -mtriple=i686-linux-android < %s | FileCheck -check-prefix=CHECK-X86-32 %s
3
4define i32 @foo() local_unnamed_addr #0 {
5
6  %a = alloca i32, i64 18000, align 16
7  %b0 = getelementptr inbounds i32, i32* %a, i64 98
8  %b1 = getelementptr inbounds i32, i32* %a, i64 7198
9  store volatile i32 1, i32* %b0
10  store volatile i32 1, i32* %b1
11  %c = load volatile i32, i32* %a
12  ret i32 %c
13}
14
15attributes #0 =  {"probe-stack"="inline-asm"}
16
17; CHECK-X86-64-LABEL: foo:
18; CHECK-X86-64:        # %bb.0:
19; CHECK-X86-64-NEXT:	movq	%rsp, %r11
20; CHECK-X86-64-NEXT:	subq	$69632, %r11 # imm = 0x11000
21; CHECK-X86-64-NEXT:   .LBB0_1:
22; CHECK-X86-64-NEXT:	subq	$4096, %rsp # imm = 0x1000
23; CHECK-X86-64-NEXT:	movq	$0, (%rsp)
24; CHECK-X86-64-NEXT:	cmpq	%r11, %rsp
25; CHECK-X86-64-NEXT:	jne	.LBB0_1
26; CHECK-X86-64-NEXT:# %bb.2:
27; CHECK-X86-64-NEXT:	subq    $2248, %rsp
28; CHECK-X86-64-NEXT:	.cfi_def_cfa_offset 71888
29; CHECK-X86-64-NEXT:	movl	$1, 264(%rsp)
30; CHECK-X86-64-NEXT:	movl	$1, 28664(%rsp)
31; CHECK-X86-64-NEXT:	movl	-128(%rsp), %eax
32; CHECK-X86-64-NEXT:	addq	$71880, %rsp # imm = 0x118C8
33; CHECK-X86-64-NEXT:	.cfi_def_cfa_offset 8
34; CHECK-X86-64-NEXT:	retq
35
36; CHECK-X86-32-LABEL: foo:
37; CHECK-X86-32:      # %bb.0:
38; CHECK-X86-32-NEXT:    movl    %esp, %r11d
39; CHECK-X86-32-NEXT:    subl    $69632, %r11d # imm = 0x11000
40; CHECK-X86-32-NEXT:    .LBB0_1: # =>This Inner Loop Header: Depth=1
41; CHECK-X86-32-NEXT:    subl    $4096, %esp # imm = 0x1000
42; CHECK-X86-32-NEXT:    movl    $0, (%esp)
43; CHECK-X86-32-NEXT:    cmpl    %r11d, %esp
44; CHECK-X86-32-NEXT:    jne  .LBB0_1
45; CHECK-X86-32-NEXT:# %bb.2:
46; CHECK-X86-32-NEXT:    subl    $2380, %esp
47; CHECK-X86-32-NEXT:    .cfi_def_cfa_offset 72016
48; CHECK-X86-32-NEXT:    movl    $1, 392(%esp)
49; CHECK-X86-32-NEXT:    movl    $1, 28792(%esp)
50; CHECK-X86-32-NEXT:    movl    (%esp), %eax
51; CHECK-X86-32-NEXT:    addl    $72012, %esp # imm = 0x1194C
52; CHECK-X86-32-NEXT:    .cfi_def_cfa_offset 4
53; CHECK-X86-32-NEXT:    retl
54