1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnux32 -verify-machineinstrs | FileCheck %s
4 target datalayout = "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnux32"
7 ; probe-stack + dynamic size alloca
8 define void @test1(i32 %size) nounwind #0 {
10 ; CHECK: # %bb.0: # %start
11 ; CHECK-NEXT: pushq %rbp
12 ; CHECK-NEXT: movl %esp, %ebp
13 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
14 ; CHECK-NEXT: leal 15(%rdi), %eax
15 ; CHECK-NEXT: andl $-16, %eax
16 ; CHECK-NEXT: callq __rust_probestack
17 ; CHECK-NEXT: subl %eax, %esp
19 %alloca = alloca i8, i32 %size
23 ; probe-stack + no-stack-arg-probe + dynamic size alloca
24 define void @test2(i32 %size) nounwind #1 {
26 ; CHECK: # %bb.0: # %start
27 ; CHECK-NEXT: pushq %rbp
28 ; CHECK-NEXT: movl %esp, %ebp
29 ; CHECK-NEXT: addl $15, %edi
30 ; CHECK-NEXT: andl $-16, %edi
31 ; CHECK-NEXT: subl %edi, %esp
33 %alloca = alloca i8, i32 %size
37 ; probe-stack + fixed size alloca not in entry block
38 define void @test3() nounwind #0 {
40 ; CHECK: # %bb.0: # %start
41 ; CHECK-NEXT: pushq %rbp
42 ; CHECK-NEXT: movl %esp, %ebp
43 ; CHECK-NEXT: pushq %rax
44 ; CHECK-NEXT: subl $1992, %esp # imm = 0x7C8
49 %alloca = alloca i8, i32 2000
53 attributes #0 = { "probe-stack"="__rust_probestack" }
54 attributes #1 = { "probe-stack"="__rust_probestack" "no-stack-arg-probe" }