78 lines · plain
1; This test is attempting to detect that the compiler correctly generates stack2; probe calls when the size of the local variables exceeds the specified stack3; probe size.4;5; Testing the default value of 4096 bytes makes sense, because the default6; stack probe size equals the page size (4096 bytes for all x86 targets), and7; this is unlikely to change in the future.8;9; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s10 11target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"12 13define i32 @test1() "stack-probe-size"="0" {14 %buffer = alloca [4095 x i8]15 16 ret i32 017 18; CHECK-LABEL: _test1:19; CHECK-NOT: subl $4095, %esp20; CHECK: movl $4095, %eax21; CHECK: calll __chkstk22}23 24define i32 @test2() {25 %buffer = alloca [4095 x i8]26 27 ret i32 028 29; CHECK-LABEL: _test2:30; CHECK-NOT: movl $4095, %eax31; CHECK: subl $4095, %esp32; CHECK-NOT: calll __chkstk33}34 35define i32 @test3() "stack-probe-size"="8192" {36 %buffer = alloca [4095 x i8]37 38 ret i32 039 40; CHECK-LABEL: _test3:41; CHECK-NOT: movl $4095, %eax42; CHECK: subl $4095, %esp43; CHECK-NOT: calll __chkstk44}45 46define i32 @test4() "stack-probe-size"="0" {47 %buffer = alloca [4096 x i8]48 49 ret i32 050 51; CHECK-LABEL: _test4:52; CHECK-NOT: subl $4096, %esp53; CHECK: movl $4096, %eax54; CHECK: calll __chkstk55}56 57define i32 @test5() {58 %buffer = alloca [4096 x i8]59 60 ret i32 061 62; CHECK-LABEL: _test5:63; CHECK-NOT: subl $4096, %esp64; CHECK: movl $4096, %eax65; CHECK: calll __chkstk66}67 68define i32 @test6() "stack-probe-size"="8192" {69 %buffer = alloca [4096 x i8]70 71 ret i32 072 73; CGECK-LABEL: _test6:74; CGECK-NOT: movl $4096, %eax75; CGECK: subl $4096, %esp76; CGECK-NOT: calll __chkstk77}78