1 ; This test is attempting to detect that the compiler correctly generates stack
2 ; probe calls when the size of the local variables exceeds the specified stack
5 ; Testing the default value of 4096 bytes makes sense, because the default
6 ; stack probe size equals the page size (4096 bytes for all x86 targets), and
7 ; this is unlikely to change in the future.
9 ; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s
11 target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
13 define i32 @test1() "stack-probe-size"="0" {
14 %buffer = alloca [4095 x i8]
18 ; CHECK-LABEL: _test1:
19 ; CHECK-NOT: subl $4095, %esp
20 ; CHECK: movl $4095, %eax
21 ; CHECK: calll __chkstk
25 %buffer = alloca [4095 x i8]
29 ; CHECK-LABEL: _test2:
30 ; CHECK-NOT: movl $4095, %eax
31 ; CHECK: subl $4095, %esp
32 ; CHECK-NOT: calll __chkstk
35 define i32 @test3() "stack-probe-size"="8192" {
36 %buffer = alloca [4095 x i8]
40 ; CHECK-LABEL: _test3:
41 ; CHECK-NOT: movl $4095, %eax
42 ; CHECK: subl $4095, %esp
43 ; CHECK-NOT: calll __chkstk
46 define i32 @test4() "stack-probe-size"="0" {
47 %buffer = alloca [4096 x i8]
51 ; CHECK-LABEL: _test4:
52 ; CHECK-NOT: subl $4096, %esp
53 ; CHECK: movl $4096, %eax
54 ; CHECK: calll __chkstk
58 %buffer = alloca [4096 x i8]
62 ; CHECK-LABEL: _test5:
63 ; CHECK-NOT: subl $4096, %esp
64 ; CHECK: movl $4096, %eax
65 ; CHECK: calll __chkstk
68 define i32 @test6() "stack-probe-size"="8192" {
69 %buffer = alloca [4096 x i8]
73 ; CGECK-LABEL: _test6:
74 ; CGECK-NOT: movl $4096, %eax
75 ; CGECK: subl $4096, %esp
76 ; CGECK-NOT: calll __chkstk